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.
This commit is contained in:
parent
fe1befcadf
commit
5eeb6c00be
|
@ -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. */
|
||||
|
|
|
@ -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! */
|
||||
};
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue