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
Member

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:

image

And this is how the PR looks, with both titles at the top:

image

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:

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: ![image](/attachments/fa0a9079-6340-41c0-a75e-e30234b57b7d) And this is how the PR looks, with both titles at the top: ![image](/attachments/f9aef40a-5f9d-48c6-a5cc-f11778a454b4) 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: <video controls loop src="/attachments/b4e59bb3-7f4a-44dc-b144-02fe1ea9ad2f"></video>
Harley Acheson added 1 commit 2023-07-06 22:36:50 +02:00
70e529cfc8 WIP: UI: Consistent Menu/Block/Popup Ordering
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
Harley Acheson added this to the User Interface project 2023-07-06 22:36:59 +02:00
Harley Acheson requested review from Pablo Vazquez 2023-07-07 04:28:28 +02:00
Pablo Vazquez added the
Module
User Interface
label 2023-07-07 11:11:23 +02:00
Harley Acheson changed title from WIP: UI: Consistent Menu/Block/Popup Content Ordering to UI: Consistent Menu/Block/Popup Content Ordering 2023-07-20 23:27:38 +02:00
Member

I 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.

I 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.
Member

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.

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.
First-time contributor

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

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](https://github.com/adamearle/Blender-Tear-Off-Menu)
Harley Acheson added 2 commits 2023-08-24 02:08:03 +02:00
Author
Member

No consensus among the UI Module. Pablo will probably have to decide.

No consensus among the UI Module. Pablo will probably have to decide.
Member

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.

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.

image

It's not always the case, sometimes the label is different from the title.
image

And sometimes there's no label and the title really helps:
image
image

Even with these cases, I think it's worth for the sake of consistency with custom menus (like Add) and popovers.

> 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. 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. ![image](/attachments/36db12e9-7955-4028-be78-b35e644e81c2) It's not always the case, sometimes the label is different from the title. ![image](/attachments/ce2a284a-0e35-4e6c-8b17-935441ea9282) And sometimes there's no label and the title really helps: ![image](/attachments/7c0afb7e-73df-4b71-8c0c-d81ca26dab2c) ![image](/attachments/2f336fe6-792c-4ead-b1ec-40e6ebb77fe1) Even with these cases, I think it's worth for the sake of consistency with custom menus (like Add) and popovers.
Harley Acheson added 2 commits 2023-08-25 04:24:40 +02:00
Author
Member

@pablovazquez - ...why I'm not 100% on this, is when the exact same title appears right next to the dropdown as label.

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.

> @pablovazquez - ...why I'm not 100% on this, is when the exact same title appears right next to the dropdown as label. 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**.
Member

Awesome!

...so it only shows the title if the button has an icon and blank text.

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:
image

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.

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.

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:

Awesome! > ...so it only shows the title if the button has an icon and blank text. 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: ![image](/attachments/df6f56dc-87a5-4419-af73-08acc9b5b0f6) 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. > 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**. 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: <video controls loop src="/attachments/b4e59bb3-7f4a-44dc-b144-02fe1ea9ad2f"></video>
Harley Acheson added 2 commits 2023-08-25 17:31:19 +02:00
Author
Member

@pablovazquez - I think the title should show if the button has blank text, regardless of having an icon or not.

Great idea. I updated the PR to do that.

This is great! If we can tweak that behavior of showing also on menus without icon, I'd say it's good to go!

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.

> @pablovazquez - I think the title should show if the button has blank text, regardless of having an icon or not. Great idea. I updated the PR to do that. > This is great! If we can tweak that behavior of showing also on menus without icon, I'd say it's good to go! 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.
Pablo Vazquez approved these changes 2023-08-25 17:45:53 +02:00
Pablo Vazquez left a comment
Member

Thanks for the update!

Approved from the UI point of view.

Thanks for the update! Approved from the UI point of view.
Harley Acheson requested review from Campbell Barton 2023-08-25 17:52:24 +02:00
Author
Member

@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)

@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)
Harley Acheson added 2 commits 2023-08-30 00:55:37 +02:00
Harley Acheson requested review from Julian Eisel 2023-08-30 00:56:01 +02:00
Julian Eisel requested changes 2023-08-30 10:19:39 +02:00
Julian Eisel left a comment
Member

Looking good on a quick check, didn't test yet. Needs versioning still.

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,
Member

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.
Author
Member

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
Harley marked this conversation as resolved
@ -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),
Member

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.
Author
Member

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.
Harley marked this conversation as resolved
Harley Acheson added 2 commits 2023-08-30 17:50:36 +02:00
Julian Eisel requested changes 2023-08-30 20:11:48 +02:00
@ -860,6 +860,10 @@ void blo_do_versions_userdef(UserDef *userdef)
userdef->uiflag |= USER_NODE_AUTO_OFFSET;
}
if (!USER_VERSION_ATLEAST(400, 20)) {
Member

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.
Harley marked this conversation as resolved
@ -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. */
Member

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).
Harley marked this conversation as resolved
Harley Acheson added 2 commits 2023-08-30 22:29:48 +02:00
Author
Member

@blender-bot build

@blender-bot build
Campbell Barton approved these changes 2023-08-31 12:05:23 +02:00
Julian Eisel approved these changes 2023-08-31 12:06:49 +02:00
Harley Acheson merged commit b122faf705 into main 2023-08-31 20:25:02 +02:00
Harley Acheson deleted branch MenuDirection 2023-08-31 20:25:03 +02:00
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#109798
No description provided.