diff options
author | Julian Eisel <julian@blender.org> | 2022-05-11 19:25:11 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-05-11 19:29:20 +0300 |
commit | 8d9d5da13706b668b9bd0d631e00c9b00b73f3ea (patch) | |
tree | ff2115b3620da745b6cdef38fb60a569c1e57745 /source | |
parent | 007184bcf2121296fa244871382670b0f06210c0 (diff) |
Cleanup (UI): Make space for more internal button flags
Having to manually increase all other flag values to be able to add a
new internal flag is quite annoying. Just make space for a few more
once.
Generally I'd say internal flags are preferable, since it increases
encapsulation. So good to avoid making this a hassle.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 50 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 3 |
2 files changed, 27 insertions, 26 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 0b507c6a4ab..a996d1e0e76 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -184,50 +184,50 @@ enum { /** #uiBut.flag general state flags. */ enum { - /* WARNING: the first 7 flags are internal (see #UI_SELECT definition). */ - UI_BUT_ICON_SUBMENU = 1 << 7, - UI_BUT_ICON_PREVIEW = 1 << 8, + /* WARNING: the first 10 flags are internal (see #UI_SELECT definition). */ + UI_BUT_ICON_SUBMENU = 1 << 10, + UI_BUT_ICON_PREVIEW = 1 << 11, - UI_BUT_NODE_LINK = 1 << 9, - UI_BUT_NODE_ACTIVE = 1 << 10, - UI_BUT_DRAG_LOCK = 1 << 11, + UI_BUT_NODE_LINK = 1 << 12, + UI_BUT_NODE_ACTIVE = 1 << 13, + UI_BUT_DRAG_LOCK = 1 << 14, /** Grayed out and un-editable. */ - UI_BUT_DISABLED = 1 << 12, + UI_BUT_DISABLED = 1 << 15, - UI_BUT_ANIMATED = 1 << 13, - UI_BUT_ANIMATED_KEY = 1 << 14, - UI_BUT_DRIVEN = 1 << 15, - UI_BUT_REDALERT = 1 << 16, + UI_BUT_ANIMATED = 1 << 16, + UI_BUT_ANIMATED_KEY = 1 << 17, + UI_BUT_DRIVEN = 1 << 18, + UI_BUT_REDALERT = 1 << 19, /** Grayed out but still editable. */ - UI_BUT_INACTIVE = 1 << 17, - UI_BUT_LAST_ACTIVE = 1 << 18, - UI_BUT_UNDO = 1 << 19, - UI_BUT_IMMEDIATE = 1 << 20, - UI_BUT_NO_UTF8 = 1 << 21, + UI_BUT_INACTIVE = 1 << 20, + UI_BUT_LAST_ACTIVE = 1 << 21, + UI_BUT_UNDO = 1 << 22, + UI_BUT_IMMEDIATE = 1 << 23, + UI_BUT_NO_UTF8 = 1 << 24, /** For popups, pressing return activates this button, overriding the highlighted button. * For non-popups this is just used as a display hint for the user to let them * know the action which is activated when pressing return (file selector for eg). */ - UI_BUT_ACTIVE_DEFAULT = 1 << 23, + UI_BUT_ACTIVE_DEFAULT = 1 << 25, /** This but is "inside" a list item (currently used to change theme colors). */ - UI_BUT_LIST_ITEM = 1 << 24, + UI_BUT_LIST_ITEM = 1 << 26, /** edit this button as well as the active button (not just dragging) */ - UI_BUT_DRAG_MULTI = 1 << 25, + UI_BUT_DRAG_MULTI = 1 << 27, /** Use for popups to start editing the button on initialization. */ - UI_BUT_ACTIVATE_ON_INIT = 1 << 26, + UI_BUT_ACTIVATE_ON_INIT = 1 << 28, /** #uiBut.str contains #UI_SEP_CHAR, used for key shortcuts */ - UI_BUT_HAS_SEP_CHAR = 1 << 27, + UI_BUT_HAS_SEP_CHAR = 1 << 29, /** Don't run updates while dragging (needed in rare cases). */ - UI_BUT_UPDATE_DELAY = 1 << 28, + UI_BUT_UPDATE_DELAY = 1u << 30, /** When widget is in text-edit mode, update value on each char stroke. */ - UI_BUT_TEXTEDIT_UPDATE = 1 << 29, + UI_BUT_TEXTEDIT_UPDATE = 1ul << 31, /** Show 'x' icon to clear/unlink value of text or search button. */ - UI_BUT_VALUE_CLEAR = 1 << 30, + UI_BUT_VALUE_CLEAR = 1ul << 32, /** RNA property of the button is overridden from linked reference data. */ - UI_BUT_OVERRIDDEN = 1u << 31u, + UI_BUT_OVERRIDDEN = 1ul << 33, }; /* Default font size for normal text. */ diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 98aed39c2ac..e8c5f2bb322 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -74,7 +74,8 @@ enum { UI_SELECT_DRAW = (1 << 5), /** Property search filter is active and the button does not match. */ UI_SEARCH_FILTER_NO_MATCH = (1 << 6), - /* WARNING: rest of #uiBut.flag in UI_interface.h */ + + /* WARNING: rest of #uiBut.flag in UI_interface.h (starting at `1 << 10`). */ }; /** #uiBut.dragflag */ |