diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-12 01:54:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-12 01:54:26 +0300 |
commit | 6f6d76554f4eb5335a42874da65d2fca7bbb2cb0 (patch) | |
tree | f8112969e8e760e9cf00c58f4a0b83fad9832336 | |
parent | 45881003f0efc14e50a055c7b5c3feec1f2b890c (diff) |
UI: move layer up/down reverse into the operator
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 8 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_data.c | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 192cacd6fea..f40307b5b11 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -376,12 +376,8 @@ class TOPBAR_PT_gpencil_layers(Panel): col.separator() sub = col.column(align=True) - 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' + sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP' + sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN' col.separator() diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index bfaf0ee2659..64cb91c3e14 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -338,7 +338,8 @@ static int gp_layer_move_exec(bContext *C, wmOperator *op) bGPdata *gpd = ED_gpencil_data_get_active(C); bGPDlayer *gpl = BKE_gpencil_layer_getactive(gpd); - int direction = RNA_enum_get(op->ptr, "type"); + const bool reverse = (bool)(U.gp_settings & GP_PAINT_REVERSE_LAYERS); + const int direction = RNA_enum_get(op->ptr, "type") * (reverse ? -1 : 1); /* sanity checks */ if (ELEM(NULL, gpd, gpl)) |