Fix #128231: Wrong padding for gizmo and menu tooltips #128243

Merged
Harley Acheson merged 1 commits from PratikPB2123/blender:128231-tooltip-padding into blender-v4.3-release 2024-10-04 20:12:49 +02:00
Member

This is due to wrong is_pad is passed as argument. It should be false
for gizmo tooltips. For menus when fields size is zero i.e. no
element is appended yet, the python message will be at the top of
tooltip region.

This is due to wrong `is_pad` is passed as argument. It should be false for gizmo tooltips. For menus when fields size is zero i.e. no element is appended yet, the python message will be at the top of tooltip region.
Pratik Borhade requested review from Harley Acheson 2024-09-27 12:43:17 +02:00
Pratik Borhade added the
Module
User Interface
label 2024-09-27 12:43:25 +02:00
Pratik Borhade requested review from Pablo Vazquez 2024-09-27 12:43:34 +02:00
Member

Good find. That "is_pad" only adds a space above the item being added, so shouldn't happen for UI_TIP_STYLE_HEADER.

Note for the change in ui_tooltip_data_from_gizmo (1178) you could just remove that argument since it has a default value of false. Whatever you find more readable.

I'm curious about the proposed change at ui_tooltip_data_from_button_or_extra_icon (1041). Is there something special about that one versus other instances of items added with is_pad true in the same function?

Good find. That "is_pad" only adds a space above the item being added, so shouldn't happen for UI_TIP_STYLE_HEADER. Note for the change in `ui_tooltip_data_from_gizmo` (1178) you could just remove that argument since it has a default value of false. Whatever you find more readable. I'm curious about the proposed change at `ui_tooltip_data_from_button_or_extra_icon` (1041). Is there something special about that one versus other instances of items added with is_pad true in the same function?
Author
Member

I'm curious about the proposed change at ui_tooltip_data_from_button_or_extra_icon (1041). Is there something special about that one versus other instances of items added with is_pad true in the same function?

Yes. Padding for python tip is useful if it has any content above it ([0]).
In other cases[1], when no other content is printed in tooltip-region, padding to python tip would misalign the text.

[0]: Example: Auto keyframing panel (downarrow)
[1]: Example: Object menu in header: When menu button already has the label, tooltip-region ignores that text:

/* Regular (non-custom) label. Only show when the button doesn't already show the label. Check
* prefix instead of comparing because the button may include the shortcut. Buttons with dynamic
* tool-tips also don't get their default label here since they can already provide more accurate
* and specific tool-tip content. */
else if (!but_label.empty() && !blender::StringRef(but->drawstr).startswith(but_label) &&
!but->tip_func)
{
UI_tooltip_text_field_add(*data, but_label, {}, UI_TIP_STYLE_HEADER, UI_TIP_LC_NORMAL);
}

> I'm curious about the proposed change at ui_tooltip_data_from_button_or_extra_icon (1041). Is there something special about that one versus other instances of items added with is_pad true in the same function? Yes. Padding for python tip is useful if it has any content above it ([0]). In other cases[1], when no other content is printed in tooltip-region, padding to python tip would misalign the text. [0]: Example: Auto keyframing panel (downarrow) [1]: Example: Object menu in header: When menu button already has the label, tooltip-region ignores that text: https://projects.blender.org/blender/blender/src/commit/c1634dbe4b2742c2066dc4493e69604e63f591fe/source/blender/editors/interface/regions/interface_region_tooltip.cc#L852-L860
Member

@blender-bot build

@blender-bot build
Member

@blender-bot build

@blender-bot build
Harley Acheson changed target branch from main to blender-v4.3-release 2024-10-04 20:02:58 +02:00
Harley Acheson changed target branch from blender-v4.3-release to main 2024-10-04 20:03:30 +02:00
Harley Acheson force-pushed 128231-tooltip-padding from 8e58df7d96 to c7515c8fb7 2024-10-04 20:10:15 +02:00 Compare
Harley Acheson changed target branch from main to blender-v4.3-release 2024-10-04 20:10:41 +02:00
Harley Acheson merged commit 826ba8e27a into blender-v4.3-release 2024-10-04 20:12:49 +02:00
Author
Member

Thanks, added to 4.2 backporting list

Thanks, added to 4.2 backporting list
Pratik Borhade deleted branch 128231-tooltip-padding 2024-10-05 12:31:56 +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
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & 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#128243
No description provided.