diff options
author | Antonioya <blendergit@gmail.com> | 2018-10-11 19:27:09 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-10-11 19:30:10 +0300 |
commit | d6dc8cda8b7a70f23db745d63e8119ff67212909 (patch) | |
tree | 4e7232e55de32871a9c63ba54c00c681df214270 /release/scripts/startup/bl_ui | |
parent | 18f117594004e51f95f345d1a95bd8f54cd5bd11 (diff) |
GP: Invert UP/DOWN buttons when layer list is inverted
This fix the task T56985
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_gpencil.py | 15 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 14 |
2 files changed, 23 insertions, 6 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py index 858f189fe3a..470560c3cd0 100644 --- a/release/scripts/startup/bl_ui/properties_data_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py @@ -125,11 +125,16 @@ class DATA_PT_gpencil_datapanel(Panel): self.draw_layers(context, layout, gpd) def draw_layers(self, context, layout, gpd): + userpref = context.user_preferences + edit = userpref.edit + reverse = edit.use_grease_pencil_reverse_layers + row = layout.row() col = row.column() layer_rows = 7 - col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index", rows=layer_rows) + col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index", + rows=layer_rows, reverse=reverse) col = row.column() @@ -145,8 +150,12 @@ class DATA_PT_gpencil_datapanel(Panel): col.separator() sub = col.column(align=True) - sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP' - sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN' + if reverse is False: + sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP' + sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN' + else: + sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'DOWN' + sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'UP' col.separator() diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index c25c3d38560..192cacd6fea 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -352,11 +352,15 @@ class TOPBAR_PT_gpencil_layers(Panel): self.draw_layers(context, layout, gpd) def draw_layers(self, context, layout, gpd): + userpref = context.user_preferences + edit = userpref.edit + reverse = edit.use_grease_pencil_reverse_layers row = layout.row() col = row.column() layer_rows = 10 - col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index", rows=layer_rows) + col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index", + rows=layer_rows, reverse=reverse) col = row.column() @@ -372,8 +376,12 @@ class TOPBAR_PT_gpencil_layers(Panel): col.separator() sub = col.column(align=True) - sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP' - sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN' + if reverse is False: + sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP' + sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN' + else: + sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'DOWN' + sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'UP' col.separator() |