diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-01-09 17:48:09 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-01-09 17:51:46 +0300 |
commit | 90e354fd7a6989f6d93309a2af68b8bdb60434fc (patch) | |
tree | bfcb60b294a1cf5a9699f16d8171723c63212a05 /source/blender/makesdna/DNA_screen_types.h | |
parent | 1c42f1c5ca52bedec9b016edcb5fc7ff75754509 (diff) |
Revert/Redo ugly rBd12b3767f81d commit (i.e. add locked sorting option to UIList).
Too many things done wrong in original rBd12b3767f81d to list them all
here, hopefully nothing bad sneaked in again this time :|
Also cleaned up a little the 'sort by name', even though (since we only
have two options by default, sort by index and by name) we can abuse it
as a binary option for now, this is not a bitflag...
Diffstat (limited to 'source/blender/makesdna/DNA_screen_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_screen_types.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 85be6cac383..869f8c029a3 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -551,14 +551,18 @@ enum { UILST_FLT_EXCLUDE = UILST_FLT_ITEM, /* Exclude filtered items, *must* use this same value. */ }; -/* uiList filter orderby type */ +/* uiList filter sort type */ enum { - UILST_FLT_SORT_ALPHA = 1 << 0, - UILST_FLT_FORCED_REVERSE = 1 << 1, /* Special flag to indicate reverse was set by external parameter */ + /* Plain values (only one is valid at a time, once masked with UILST_FLT_SORT_MASK. */ + UILST_FLT_SORT_INDEX = 0, /* Just for sake of consistency. */ + UILST_FLT_SORT_ALPHA = 1, + + /* Bitflags affecting behavior of any kind of sorting. */ + UILST_FLT_SORT_LOCK = 1u << 30, /* Special flag to indicate that order is locked (not user-changeable). */ UILST_FLT_SORT_REVERSE = 1u << 31 /* Special value, bitflag used to reverse order! */ }; -#define UILST_FLT_SORT_MASK (((unsigned int)UILST_FLT_SORT_REVERSE) - 1) +#define UILST_FLT_SORT_MASK (((unsigned int)(UILST_FLT_SORT_REVERSE | UILST_FLT_SORT_LOCK)) - 1) /* regiontype, first two are the default set */ /* Do NOT change order, append on end. Types are hardcoded needed */ |