[Feature] Impose GroupLayer
order on LayerList
to update view. #9
Closed
Description
Is your feature request related to a problem? Please describe.
Currently reordering the items in the group layer list does not affect how the canvas appears (IE what layers appear above the others). Such changes are only reflected in updates to the LayerList interface itself.
Describe the solution you'd like
- A button should be added to the GroupLayersWidget that when pressed returns a "flattened" order for the Layers.This button should then impose this order on the existing LayerList to re-render the canvas.(Extension) if a group is selected, allow imposing of the relative ordering of the layers within that group on the canvas.
Describe alternatives you've considered
Additional context
Activity
willGraham01 commentedon Jun 20, 2024
This also concerns #16 - once we can impose the order of the layers back onto the main view, we can setup the appropriate signals to be emitted automatically and update the view without need of a button
willGraham01 commentedon Jun 28, 2024
@K-Meech @alessandrofelder I have the widget now sync-ing the group layer order back to the main layer window, however had some things I wanted to run past you both about a sensible implementation for the reverse direction.
Since there are no groups in the main viewer, it is feasible that we could end up in a situation like this:
Now suppose that the user moves Layer_4 above Layer_2 in the main viewer. Clearly Layer_4 should then move above Layer_2 in the group layer viewer, but it's not clear if it should go into Group_A or not.
Going further, if we have this situation:
there are even more questions if Layer_4 gets moved - does Group_B go with it?
LayerDelegate
responsibility coming, this doesn't sound too restrictive but isn't ideal.This is more a problem of us implementing things as a plugin rather than as core napari - if our plugin was replacing the main viewer, we wouldn't have this issue of course (as we wouldn't need to sync the two views)! Hence why I suggest option 2 above 😅
K-Meech commentedon Jun 28, 2024
Great - thanks @willGraham01 ! My preference would also be for option 2.
Once the plugin is open, I think the idea is to ignore the 'real' layer list / controls as much as possible and just makes sure everything works consistently inside the plugin itself. If the syncing from the group layers back to the layer list works, then I'm not sure we need it in the other direction for now.
willGraham01 commentedon Jul 5, 2024
Closing as complete in #26