UI: Consistent Menu/Block/Popup Content Ordering #109798

Merged
Harley Acheson merged 13 commits from Harley/blender:MenuDirection into main 2023-08-31 20:25:02 +02:00
3 changed files with 16 additions and 12 deletions
Showing only changes of commit 1b721e272b - Show all commits

View File

@ -860,6 +860,10 @@ void blo_do_versions_userdef(UserDef *userdef)
userdef->uiflag |= USER_NODE_AUTO_OFFSET;
}
if (!USER_VERSION_ATLEAST(400, 20)) {
Harley marked this conversation as resolved Outdated

Version number is too low (won't clear the flag for files saved with current main). You can just add it to the unversioned block at the bottom of the function.

Version number is too low (won't clear the flag for files saved with current `main`). You can just add it to the unversioned block at the bottom of the function.
userdef->uiflag &= ~USER_MENUFIXEDORDER_DEPRECATED;
}
/**
* Versioning code until next subversion bump goes here.
*

View File

@ -145,19 +145,19 @@ enum {
/** #uiBlock.flag (controls) */
enum {
UI_BLOCK_LOOP = 1 << 0,
UI_BLOCK_NUMSELECT = 1 << 3,
UI_BLOCK_NUMSELECT = 1 << 1,
Harley marked this conversation as resolved Outdated

Best update the following flag values, makes it easier to see that there are unused values.

Best update the following flag values, makes it easier to see that there are unused values.

Make sense. I only updated the first section, down to bit 11, because of the 14-17 overlap with uiBut::drawflag

Make sense. I only updated the first section, down to bit 11, because of the 14-17 overlap with uiBut::drawflag
/** Don't apply window clipping. */
UI_BLOCK_NO_WIN_CLIP = 1 << 4,
UI_BLOCK_CLIPBOTTOM = 1 << 5,
UI_BLOCK_CLIPTOP = 1 << 6,
UI_BLOCK_MOVEMOUSE_QUIT = 1 << 7,
UI_BLOCK_KEEP_OPEN = 1 << 8,
UI_BLOCK_POPUP = 1 << 9,
UI_BLOCK_OUT_1 = 1 << 10,
UI_BLOCK_SEARCH_MENU = 1 << 11,
UI_BLOCK_POPUP_MEMORY = 1 << 12,
UI_BLOCK_NO_WIN_CLIP = 1 << 2,
UI_BLOCK_CLIPBOTTOM = 1 << 3,
UI_BLOCK_CLIPTOP = 1 << 4,
UI_BLOCK_MOVEMOUSE_QUIT = 1 << 5,
UI_BLOCK_KEEP_OPEN = 1 << 6,
UI_BLOCK_POPUP = 1 << 7,
UI_BLOCK_OUT_1 = 1 << 8,
UI_BLOCK_SEARCH_MENU = 1 << 9,
UI_BLOCK_POPUP_MEMORY = 1 << 10,
/** Stop handling mouse events. */
UI_BLOCK_CLIP_EVENTS = 1 << 13,
UI_BLOCK_CLIP_EVENTS = 1 << 11,
/* #uiBlock::flags bits 14-17 are identical to #uiBut::drawflag bits. */

View File

@ -1197,7 +1197,7 @@ typedef enum eUserpref_UI_Flag {
USER_ZOOM_TO_MOUSEPOS = (1 << 20),
USER_SHOW_FPS = (1 << 21),
USER_REGISTER_ALL_USERS = (1 << 22),
USER_UIFLAG_UNUSED_23 = (1 << 23),
USER_MENUFIXEDORDER_DEPRECATED = (1 << 23), /* Deprecated in 4.0. */
Harley marked this conversation as resolved Outdated

This needs versioning in blo_do_versions_userdef() to unset the flag for old files. No version bump needed until the flag will be reused.

This needs versioning in `blo_do_versions_userdef()` to unset the flag for old files. No version bump needed until the flag will be reused.

Thanks! Although I did also renamed this to USER_MENUFIXEDORDER_DEPRECATED and marked with comments as such. Let me know if that isn't good.

Thanks! Although I did also renamed this to USER_MENUFIXEDORDER_DEPRECATED and marked with comments as such. Let me know if that isn't good.

Should be named USER_UIFLAG_UNUSED_4, consistent with other deprecated flags (also add the `/* Cleared. */ comment).

Should be named `USER_UIFLAG_UNUSED_4`, consistent with other deprecated flags (also add the `/* Cleared. */ comment).
USER_CONTINUOUS_MOUSE = (1 << 24),
USER_ZOOM_INVERT = (1 << 25),
USER_ZOOM_HORIZ = (1 << 26), /* for CONTINUE and DOLLY zoom */