Difference between revisions of "Specs:Visibility"

From GIMP Developer Wiki
Jump to: navigation, search
Line 19: Line 19:
 
Scenario 2: all layers and groups are visible, except L1 and G3<br>
 
Scenario 2: all layers and groups are visible, except L1 and G3<br>
  
'''1. Current behaviour:'''
+
'''1. Current behaviour:'''<br>
 
on top level: hide the other layers/groups, discard their former visibility state; on lower levels: leave layers/groups untouched<br>
 
on top level: hide the other layers/groups, discard their former visibility state; on lower levels: leave layers/groups untouched<br>
  
Line 29: Line 29:
 
Shift+Click L2: hide L4 -> show L4, G3; Do not change L1<br>
 
Shift+Click L2: hide L4 -> show L4, G3; Do not change L1<br>
 
Shift+Click L4: hide L4 -> show L4, G3; Do not change L1<br>
 
Shift+Click L4: hide L4 -> show L4, G3; Do not change L1<br>
 +
 +
'''2. Proposal 1''' <br>
 +
# When toggling exclusive visibility, first note the full path from image root to the selected item (inclusively) and begin iterating through it.
 +
# IF at any point along this path there are any visible sibling items, THEN hide them, leaving only the selected item visible, and break and return.
 +
# Otherwise, if we have traversed the entire path without finding any visible siblings, then selected item is the only visible item in the whole image.  (Whether the selected item is itself a layer or group is irrelevant.)  Therefore, traverse the selected path again and ensure that any and all sibling items at any point along the path are made visible. <br>
 +
This would establish a toggle chain of all items -> selected group -> (subgroup, etc.) -> selected item in group -> all items. <br>
 +
It could also be reversed; all items -> selected item in group -> selected group -> (parent group, etc.) -> all items, but I'm not exactly sure how that logic would pan out.
 +
'''TODO:''' explain on the scenarios <br>

Revision as of 17:47, 4 June 2012

Specification for desired behaviors on toggle/untoggle Layer visibility now we have layer groups

The behaviors described here will be implemented ins a series of scripts along gimp2.9 development cycle, and tentatively made available for gimp 2.10

This topic was discussed in the developers mailing list in May of 2012 (subject 'Gimp-developer] feature: Set exclusive layer visibility within groups'). The following layer structure serves as example to clarify the proposals:

  • - G1
  • - - L1
  • - - G2
  • - - - L2
  • - - - L3
  • - L4
  • - G3
  • - - L5
  • - - L6

Scenario 1: all layers and groups are visible
Scenario 2: all layers and groups are visible, except L1 and G3

1. Current behaviour:
on top level: hide the other layers/groups, discard their former visibility state; on lower levels: leave layers/groups untouched

Scenario 1:
Shift+Click L2: hide L4, G3 -> show L4, G3
Shift+Click L4: hide G1, G3 -> show G1, G3

Scenario 2:
Shift+Click L2: hide L4 -> show L4, G3; Do not change L1
Shift+Click L4: hide L4 -> show L4, G3; Do not change L1

2. Proposal 1

  1. When toggling exclusive visibility, first note the full path from image root to the selected item (inclusively) and begin iterating through it.
  2. IF at any point along this path there are any visible sibling items, THEN hide them, leaving only the selected item visible, and break and return.
  3. Otherwise, if we have traversed the entire path without finding any visible siblings, then selected item is the only visible item in the whole image. (Whether the selected item is itself a layer or group is irrelevant.) Therefore, traverse the selected path again and ensure that any and all sibling items at any point along the path are made visible.

This would establish a toggle chain of all items -> selected group -> (subgroup, etc.) -> selected item in group -> all items.
It could also be reversed; all items -> selected item in group -> selected group -> (parent group, etc.) -> all items, but I'm not exactly sure how that logic would pan out. TODO: explain on the scenarios