Define fallback tooltip string for UI_UL_list items #126184

Merged
Harley Acheson merged 1 commits from breakingspell/blender:work/breakingspell/list-operator-label into main 2024-08-13 00:42:59 +02:00
Contributor

Corrects the tooltips for UI_UL_list items. Related: #106873

  • Reference #126183 for details and screenshots of the issue.

  • Some remaining elements will need tagged with PROP_EDITABLE to fit this workflow and offer the "Double click" tooltip, such as active_material_index. Focusing on the fix for now

Corrects the tooltips for `UI_UL_list` items. Related: https://projects.blender.org/blender/blender/pulls/106873 - Reference https://projects.blender.org/blender/blender/issues/126183 for details and screenshots of the issue. - Some remaining elements will need tagged with `PROP_EDITABLE` to fit this workflow and offer the "Double click" tooltip, such as [active_material_index](https://projects.blender.org/blender/blender/src/branch/main/source/blender/makesrna/intern/rna_object.cc#L3066). Focusing on the fix for now
Blazer Silving force-pushed work/breakingspell/list-operator-label from 450bfe01d5 to ef10a59154 2024-08-10 22:48:11 +02:00 Compare
Blazer Silving changed title from WIP: Check for PROP_EDITABLE outside of the list definiton to WIP: Check for PROP_EDITABLE outside of the list definition 2024-08-10 22:48:18 +02:00
Pratik Borhade requested review from Pratik Borhade 2024-08-12 07:18:24 +02:00
Blazer Silving force-pushed work/breakingspell/list-operator-label from ef10a59154 to d3a924a4ed 2024-08-12 18:05:34 +02:00 Compare
Blazer Silving changed title from WIP: Check for PROP_EDITABLE outside of the list definition to Check for PROP_EDITABLE outside of the list definition 2024-08-12 18:05:39 +02:00
Blazer Silving requested review from Harley Acheson 2024-08-12 18:07:29 +02:00
Member

Unless my old eyes are deceiving me, I think this change could be done with just this:

diff --git a/source/blender/editors/interface/templates/interface_template_list.cc b/source/blender/editors/interface/templates/interface_template_list.cc
index f4635ad7ac5..b22e4dbd96a 100644
--- a/source/blender/editors/interface/templates/interface_template_list.cc
+++ b/source/blender/editors/interface/templates/interface_template_list.cc
@@ -772,7 +772,10 @@ static void ui_template_list_layout_draw(const bContext *C,
                                0,
                                0,
                                org_i,
-                               editable ? TIP_("Double click to rename") : "");
+                               editable ? TIP_("Select List Item "
+                                               "(Double click to rename)") :
+                                          TIP_("Select List Item"));
+
           if ((dyntip_data = uilist_item_use_dynamic_tooltip(itemptr,
                                                              input_data->item_dyntip_propname)))
           {

Unless my old eyes are deceiving me, I think this change could be done with just this: ```Diff diff --git a/source/blender/editors/interface/templates/interface_template_list.cc b/source/blender/editors/interface/templates/interface_template_list.cc index f4635ad7ac5..b22e4dbd96a 100644 --- a/source/blender/editors/interface/templates/interface_template_list.cc +++ b/source/blender/editors/interface/templates/interface_template_list.cc @@ -772,7 +772,10 @@ static void ui_template_list_layout_draw(const bContext *C, 0, 0, org_i, - editable ? TIP_("Double click to rename") : ""); + editable ? TIP_("Select List Item " + "(Double click to rename)") : + TIP_("Select List Item")); + if ((dyntip_data = uilist_item_use_dynamic_tooltip(itemptr, input_data->item_dyntip_propname))) { ```
Author
Contributor

Hello @Harley, yes this seems to work! The reasoning behind the initial change was looking at adjacent tooltip entries, the others didn't use the shorthand boolean check this one does.

It seems the reason behind the "Unknown Action" result posting to the Undo History was the zero-length string returned previously, not the variable check: https://projects.blender.org/blender/blender/src/branch/main/source/blender/editors/interface/interface_handlers.cc#L957

It does work now that a non-zero string is defined, updating the PR with this shorthand version.

Hello @Harley, yes this seems to work! The reasoning behind the initial change was looking at adjacent tooltip entries, the others didn't use the shorthand boolean check this one does. It seems the reason behind the "Unknown Action" result posting to the Undo History was the zero-length string returned previously, not the variable check: https://projects.blender.org/blender/blender/src/branch/main/source/blender/editors/interface/interface_handlers.cc#L957 It does work now that a non-zero string is defined, updating the PR with this shorthand version.
Blazer Silving changed title from Check for PROP_EDITABLE outside of the list definition to Define fallback tooltip string for UI_UL_list items 2024-08-12 22:41:13 +02:00
Blazer Silving force-pushed work/breakingspell/list-operator-label from d3a924a4ed to 943028f8ae 2024-08-12 22:47:28 +02:00 Compare
Member

@blender-bot build

@blender-bot build
Harley Acheson approved these changes 2024-08-13 00:38:51 +02:00
Harley Acheson left a comment
Member

Seems quite reasonable. Thanks!

Seems quite reasonable. Thanks!
Harley Acheson merged commit ddc9f92777 into main 2024-08-13 00:42:59 +02:00
Blazer Silving deleted branch work/breakingspell/list-operator-label 2024-08-13 00:46:20 +02:00
Harley Acheson added this to the User Interface project 2024-08-13 02:08:38 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 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#126184
No description provided.