diff options
author | Antonioya <blendergit@gmail.com> | 2018-10-12 10:54:46 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-10-12 10:55:43 +0300 |
commit | 5eeb6c00be8de7db5608d6831a0d88bd39611771 (patch) | |
tree | 593c92a45cbeb90c968a86d9078177fd33b1144f /source | |
parent | fe1befcadfa44d012561e8dc697470b2a5cc5f36 (diff) |
GP: Disable reverse list order when uncheck userprefs option
Before, the list kept the reverse order enabled in the filter. Now the filter is reset when the option is disabled and don't need any user change or restart.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_screen_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index aee426280c2..6e869a2f902 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -3838,9 +3838,17 @@ void uiTemplateList( MEM_SAFE_FREE(dyn_data->items_filter_neworder); dyn_data->items_len = dyn_data->items_shown = -1; - /* if reverse, enable reverse flag */ + /* if reverse, enable reverse and forced flag */ if (reverse) { ui_list->filter_sort_flag |= UILST_FLT_SORT_REVERSE; + ui_list->filter_sort_flag |= UILST_FLT_FORCED_REVERSE; + } + else { + /* if it was forced, disable forced flag to restore all normal behavior */ + if (ui_list->filter_sort_flag & UILST_FLT_FORCED_REVERSE) { + ui_list->filter_sort_flag &= ~UILST_FLT_SORT_REVERSE; + ui_list->filter_sort_flag &= ~UILST_FLT_FORCED_REVERSE; + } } /* When active item changed since last draw, scroll to it. */ diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index e17c7e17450..9a57f1ae37b 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -455,6 +455,7 @@ enum { /* uiList filter orderby type */ enum { UILST_FLT_SORT_ALPHA = 1 << 0, + UILST_FLT_FORCED_REVERSE = 1 << 1, /* Special flag to indicate reverse was set by external parameter */ UILST_FLT_SORT_REVERSE = 1u << 31 /* Special value, bitflag used to reverse order! */ }; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index ad0d5cee797..1470681dec0 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3997,7 +3997,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_grease_pencil_reverse_layers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_REVERSE_LAYERS); RNA_def_property_ui_text(prop, "Layers list Top-Down", - "Order the grease pencil list of layers from Top to Down (require restart)"); + "Order the grease pencil list of layers from Top to Down"); prop = RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "gp_eraser"); |