-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data-menu: handle associated data layer logic #3370
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -358,6 +358,15 @@ def set_layer_visibility(self, layer_label, visible=True): | |
layer.visible = visible | ||
elif hasattr(layer.layer, 'data') and layer.layer.data.label == layer_label: | ||
layer.visible = layer.layer.label in self.visible_layers | ||
if not visible and self.app._get_assoc_data_parent(layer.layer.label) == layer_label: | ||
# then this is a child-layer of a parent-layer that is being hidden | ||
# so also hide the child-layer | ||
layer.visible = False | ||
|
||
if visible and (parent_label := self.app._get_assoc_data_parent(layer_label)): | ||
# ensure the parent layer is also visible | ||
self.set_layer_visibility(parent_label, visible=True) | ||
Comment on lines
+366
to
+368
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that you can make a DQ layer visible for a data entry that is currently invisible, and doing so also toggles the parent layer visibility? I think you can't do that in the current data menu, but I don't oppose to choosing that behavior going forward. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. The current data-menu disables the ability to set a child-of-a-non-visible-parent to visible. That's also an option here, but since we don't (yet) have the design to visually tie them and don't have a clear way to denote that in the UI, I figured this might be a reasonable alternative. What would you prefer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's good like this. |
||
|
||
return self.visible_layers | ||
|
||
def toggle_layer_visibility(self, layer_label): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am the walrus.