UI: Consistent Menu/Block/Popup Content Ordering #109798
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#109798
Loading…
Reference in New Issue
No description provided.
Delete Branch "Harley/blender:MenuDirection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
All Content is shown in natural top-down order regardless of where it
is initiated.
Currently, Blender menus are what is called "directional", where menu items are sorted frop top-bottom or bottom-top based on the direction the menu open. It might be a nice time, with Blender 4.0, to remove this feature and have content that is always in a consistent order.
We have a preference for this behavior but haven't exposed it to users. But I don't think that we should enable this preference. If we (re)introduce this preference, make it off by default now then on by default later, we will be stuck with this preference forever. But whether on or off the description of this preference will never make sense because of how inconsistent we are with changing the direction of various items. With "Directional" turned off then all dropdown and popup content will always have the same order.
But now consider that "Directional" preference when off. Turning it ON will then mean that SOME content in some circumstances will reverse. So the 3D Viewport, in Object Mode, if you move the header to the bottom, of the four items in the center, just one of them - Transform Pivot Point - will reverse direction. Not sure how to explain that as an option.
Another reason is that we can consider changing the order of menu items if we have one direction rather than two. The change to consistent order makes relatively small changes except for the Timeline menus. For those menus everyone is used to a particular order because that editor is generally at the bottom. If we change to consistent ordering then we could also consider changing the Timeline menus item order.
RCS Suggestion: https://blender.community/c/rightclickselect/14vo
The most contentious issue, I think, is showing titles on top. I think this is the only way to go though, since having them at the bottom is inconsistent with everything else with titles or categories. The following contrasts "Transform Pivot Point" with title on top next to "Transform Orientations". There's always a "mouse travel distance" argument but that applies to everything with a title or categories on top, including popovers or the editor select menu.
This is how it looks now with a mixed title placement:
And this is how the PR looks, with both titles at the top:
This PR also removes many of the "Titles". It shows them only if there are no categories and if the calling button's text is blank. This means that if you click on just an icon to show a list it will show the title (on top) to help give more details. But it will not in the more usual case where we have text or a label giving more information. The following shows this:
WIP: UI: Consistent Menu/Block/Popup Content Orderingto UI: Consistent Menu/Block/Popup Content OrderingI think this will take a bit to get used to but it's worth it for the sake of consistency and muscle memory in the long run.
Titles on top make sense. However, it does feel superfluous when the dropdown already has descriptive text. Would it be possible to hide the dropdown title if
text=
is defined in the layout? It wouldn't be bullet proof, since the descriptive text could be the heading of a column, but at least it would cover some cases.I would like to hear what @JulienKaspar and @JulianEisel think about this.
On the surface this is definitely the right decision imo!
But I haven't tried the patch so I can't speak on any possible corner cases yet.
the benefit of the titles area also is it's great for introducing Popout menus. A title really isn't needed for this. However, breaking longer menus up with titles for sections could be useful for breaking out sub-sections.
I have this on my list of things to do in Python. Its a little off on-topic but this is definitely something that I have considered before
https://github.com/adamearle/Blender-Tear-Off-Menu
No consensus among the UI Module. Pablo will probably have to decide.
Not a corner case but something that can happen often, and the main reason why I'm not 100% on this, is when the exact same title appears right next to the dropdown as label.
It's not always the case, sometimes the label is different from the title.
And sometimes there's no label and the title really helps:
Even with these cases, I think it's worth for the sake of consistency with custom menus (like Add) and popovers.
Actually we might be able to do something about that. We have access to the pressed button for those enum lists. So we can examine its type, flags, icon, text, etc.
I have updated this PR so it only shows the title if the button has an icon and blank text.
This means it won't show it in your first two examples when we don't want it. Yeah! However this also means it won't show the title for your last example for Subsurface Method. But for this we can just add a label.
Awesome!
I think the title should show if the button has blank text, regardless of having an icon or not.
There are parts of Blender that have menus without icon but blank text, like:
This would also make it more compatible with add-ons that are less likely to have their own custom icons but do have menus without labels.
Yes I think this should have a label regardless even in
main
now.This is great! If we can tweak that behavior of showing also on menus without icon, I'd say it's good to go!
Demo showing how well it works now:
Great idea. I updated the PR to do that.
Although this PR is very simple and straight-forward it involves some flag deprecations and code removal that would need a (quick) code review by someone else. I'll add a code reviewer once you are happy with it.
Note that when this PR gets merged I'd immediately after merge one to reverse Timeline's "View" and "Marker" menus so that they remain in the same order as they are now. They are currently ordered assuming they are always reversed order because of the usual placement of that editor at the bottom.
Thanks for the update!
Approved from the UI point of view.
@ideasman42
This was discussed in our UI module meeting, approved, and signed off by Pablo, although your thoughts are always appreciated.
Code-wise, this is a very simple "ripping out" of the block reversal code, so almost entirely code removal. Things to consider is that I might not be doing the flag deprecation correctly (UI_interface_c.hh & DNA_userdef_types.h), and whether you might want to keep some code that would become unused (UI_block_order_flip)
Looking good on a quick check, didn't test yet. Needs versioning still.
@ -149,4 +148,1 @@
* so that it knows to invert the navigation direction to match the drawing order. */
UI_BLOCK_IS_FLIP = 1 << 1,
UI_BLOCK_NO_FLIP = 1 << 2,
UI_BLOCK_NUMSELECT = 1 << 3,
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
@ -1198,3 +1198,3 @@
USER_SHOW_FPS = (1 << 21),
USER_REGISTER_ALL_USERS = (1 << 22),
USER_MENUFIXEDORDER = (1 << 23),
USER_UIFLAG_UNUSED_23 = (1 << 23),
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.
@ -860,6 +860,10 @@ void blo_do_versions_userdef(UserDef *userdef)
userdef->uiflag |= USER_NODE_AUTO_OFFSET;
}
if (!USER_VERSION_ATLEAST(400, 20)) {
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.@ -1198,3 +1198,3 @@
USER_SHOW_FPS = (1 << 21),
USER_REGISTER_ALL_USERS = (1 << 22),
USER_MENUFIXEDORDER = (1 << 23),
USER_MENUFIXEDORDER_DEPRECATED = (1 << 23), /* Deprecated in 4.0. */
Should be named
USER_UIFLAG_UNUSED_4
, consistent with other deprecated flags (also add the `/* Cleared. */ comment).@blender-bot build