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.
This commit is contained in:
Julian Eisel 2022-05-11 18:25:11 +02:00
parent 007184bcf2
commit 8d9d5da137
Notes: blender-bot 2023-09-08 04:55:43 +02:00
Referenced by issue #99204, Texture baking results are different (and worse) from previous versions of Blender.
2 changed files with 27 additions and 26 deletions

View File

@ -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. */

View File

@ -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 */