Refactor Tooltip Button #251

Open
opened 2026-04-05 16:19:19 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @Xipit on 3/19/2026

Description

I have found that there are multiple slightly different implementations of the tooltip button (small green "?" button) as well as a few different ways on how the shortcuts are structured.
To reduce technical debt and to make the codebase simpler i decided to refactor this functionality.

Along the way i noticed a few inconsistencies regarding wording, such as one tool using "Left Click", while most tools use "Left mouse button".
I also decided to add a tooltip button to the Text Gizmo (GLGizmoEmboss) to bring attention to its "Drag on surface" functionality.

P.S: These changes were originally in #12656 and #12741, but i decided to break up the changes into more reviewable chunks.

Summary:

  • Shared Code for Tooltip Button (GLGizmoUtils).
    • Before: 9 slightly different implementations .
    • In extra file (not in GLGizmoBase) because it is also used in GLCanvas3d.
  • One common data structure for shortcuts.
    • Before: 3 different data structures.
  • Adds tooltip to Text Gizmo (GLGizmoEmboss).
  • Adds shortcut description to Cut Gizmo (GLGizmoCut).
  • Fixes Tooltip for Assembly Tool (GLGizmoAssembly).
  • Moves Tooltip Caption in Assembly view (GLCanvas3d) above the UI frame to match behavior in the other tools.
  • Match wording of commonly used shortcuts (e.g. "Left mouse button").
  • Consistently use platform dependant shortcut visuals (e.g. GUI::shortkey_ctrl_prefix()).

Reviewing

I know that by looking at the "Files changed" it might seem like a complicated PR, but i think that's misleading.
It is essentially the same formula applied to all the tools:

  1. Remove own show_tooltip_information() and replace with GLGizmoUtils::render_tooltip_button().
  2. Change data structure from (mostly) m_desc["shortcut"] and m_desc["shortcut_caption"] to {"shortcut", "shortcut_caption"}.

Screenshots

Text Gizmo

image

Assembly Gizmo

Before:
image

After:
image

Assembly View

image
*Originally created by @Xipit on 3/19/2026* # Description I have found that there are multiple slightly different implementations of the tooltip button (small green "?" button) as well as a few different ways on how the shortcuts are structured. To reduce technical debt and to make the codebase simpler i decided to refactor this functionality. Along the way i noticed a few inconsistencies regarding wording, such as one tool using "Left Click", while most tools use "Left mouse button". I also decided to add a tooltip button to the Text Gizmo (GLGizmoEmboss) to bring attention to its "Drag on surface" functionality. P.S: These changes were originally in #12656 and #12741, but i decided to break up the changes into more reviewable chunks. ## Summary: - Shared Code for Tooltip Button (`GLGizmoUtils`). - Before: 9 slightly different implementations . - In extra file (not in GLGizmoBase) because it is also used in `GLCanvas3d`. - One common data structure for shortcuts. - Before: 3 different data structures. - Adds tooltip to Text Gizmo (`GLGizmoEmboss`). - Adds shortcut description to Cut Gizmo (`GLGizmoCut`). - Fixes Tooltip for Assembly Tool (`GLGizmoAssembly`). - Moves Tooltip Caption in Assembly view (`GLCanvas3d`) above the UI frame to match behavior in the other tools. - Match wording of commonly used shortcuts (e.g. "Left mouse button"). - Consistently use platform dependant shortcut visuals (e.g. `GUI::shortkey_ctrl_prefix()`). ## Reviewing I know that by looking at the "Files changed" it might seem like a complicated PR, but i think that's misleading. It is essentially the same formula applied to all the tools: 1. Remove own `show_tooltip_information()` and replace with `GLGizmoUtils::render_tooltip_button()`. 2. Change data structure from (mostly) `m_desc["shortcut"]` and `m_desc["shortcut_caption"]` to `{"shortcut", "shortcut_caption"}`. # Screenshots ## Text Gizmo <img width="485" height="556" alt="image" src="https://github.com/user-attachments/assets/00c5b23e-7ce3-4788-8bb7-2c8d5643a249" /> ## Assembly Gizmo Before: <img width="355" height="408" alt="image" src="https://github.com/user-attachments/assets/9c242ee2-e3e1-415c-83c7-e3fd48c0d732" /> After: <img width="392" height="409" alt="image" src="https://github.com/user-attachments/assets/902e9d9a-b855-4ef0-b1f0-4433c71680eb" /> ## Assembly View <img width="746" height="158" alt="image" src="https://github.com/user-attachments/assets/69c6f0d3-9610-4a63-ac23-27dd4e834724" />
MrUnknownDE added the UI/UXUI/UXUI/UXUI/UX labels 2026-04-05 16:19:19 +02:00
Sign in to join this conversation.
No Label UI/UX UI/UX UI/UX UI/UX
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#251