UI: Add title to tree view context menus #120694
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#120694
Loading…
Reference in New Issue
No description provided.
Delete Branch "PratikPB2123/blender:bcol-ctxmenu-header"
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?
Add new string member in
AbstractView
class to store title/header oftree view. Later use this to set title (
pup->title
) of context menu.Hi, noticed one more thing. If we right click visibility/solo toggle then context menu shows these bone collection operations which seems wrong to me. Want to me to handle it in this PR? (just one condition of
UI_BTYPE_VIEW_ITEM
will fix this)When titles don't have icons, they shouldn't be indented, e.g.:
I think this applies to other menus not just Bone Collections, so perhaps better as a separate patch?
Hi, for that I think we need to set
pup->title
. I'm not sure how we can obtain bone collection panel name from the button. Is it possible in any way? 🤔I'm not sure, @Harley might know.
UI: bone collection context menu improvementsto UI: Bone collection context menu header@pablovazquez hi, updated to PR and description. This should work now.
Looks good! However, looking at the code and it seems the only part that makes this a "Bone Collection" change is adding the label there.
Wouldn't it be better to just add the label all other tree views (Light Linking, Grease Pencil, Asset Browser/Shelf Catalogs, Spreadsheet) and make this patch a more general "Add title label to tree view context menus"? Note: In that case the reviewer should be Julian as he's the author of Tree Views.
Some are not yet populated, they only show "Edit Source" if Developer Extras is enabled, or not show at all since they're empty. But it doesn't hurt to have the labels already. Also better for future tree views when developers copy-paste this part of the code they remember to add it :)
Catalogs:
UI: Bone collection context menu headerto UI: Add title to tree view context menus@pablovazquez thanks, done :)
@ -206,3 +206,3 @@
"asset catalog tree view",
std::make_unique<AssetCatalogSelectorTree>(*library, *shelf));
tree_view->label = "Catalog";
These strings need translation.
@ -66,3 +66,3 @@
public:
virtual ~AbstractView() = default;
std::string label;
I'd avoid public members in classes like this generally, plus I'd avoid mixing public and non-public members scattered throughout the class. Just add this to the other private members at the top of the struct definition, and add a public getter/setter.
label
is also a bit misleading maybe. I'd just call it "context menu title", for as long as it's just that at least.@ -6422,2 +6422,4 @@
return but.str.substr(0, str_len);
}
if (but.type == UI_BTYPE_VIEW_ITEM) {
This isn't semantically correct, the function is called
UI_but_string_get_label()
but here we don't return the button label, but the label we want to use for the popup. In other cases we may also want to query the label and don't expect to get this string in case of view item buttons (we already do actually).Suggestion: Add a
UI_but_context_menu_title_from_button()
which can handle the view-item case and returnsUI_but_string_get_label()
for other cases. This can be called byui_popup_context_menu_for_button()
.Checkout
From your project repository, check out a new branch and test the changes.