Skip to content

Add custom tooltip - #46

Merged
timrid merged 10 commits into
mainfrom
optimized-tooltip
Jul 30, 2026
Merged

Add custom tooltip#46
timrid merged 10 commits into
mainfrom
optimized-tooltip

Conversation

@timrid

@timrid timrid commented Jul 29, 2026

Copy link
Copy Markdown
Owner

There are two main problems with the default windows tooltip:

  • It disappears automatically after a while. So long texts are not easily readable
  • it is not possible to select and copy the text from the Toolbox

To fix this a custom toolbox was created.

Old:
Old

New:
New

There are two main problems with the default windows tooltip:
- It disappears automatically after a while. So long texts are not easily readable
- it is not possible to select and copy the text from the Toolbox

To fix this a custom toolbox was created.
Comment thread construct_editor/wx_widgets/wx_construct_editor.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the native Windows tooltip behavior in the wx-based Construct Editor with a custom, persistent popup tooltip that supports long text and text selection/copying, and adds wx integration tests around the new hover/positioning behavior.

Changes:

  • Introduces WxHoverToolTip / WxHoverToolTipPopup (custom popup tooltip with wrapping, clamping, and hover/poll lifecycle).
  • Wires the Construct Editor’s DVC hover logic to the new tooltip and hides it on scroll/selection/reload.
  • Adds wx integration tests for tooltip timing, persistence, clamping, and Construct Editor anchoring/positioning; extends wx test harness with wait_ms() and linear mouse movement.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/wx_integration/wx_test_helpers.py Adds move_mouse_linear() + wait_ms() and a helper to compute Construct Editor cell screen rects for UI tests.
tests/wx_integration/test_wx_hover_tooltip.py New integration tests validating tooltip delays, hiding rules, wrapping behavior, and display clamping.
tests/wx_integration/test_wx_construct_editor_tooltip.py New regression tests for Construct Editor tooltip positioning and “don’t hide while selecting/copying” scenarios.
construct_editor/wx_widgets/wx_hover_tooltip.py New custom tooltip implementation using wx.PopupWindow + polling logic.
construct_editor/wx_widgets/wx_construct_editor.py Hooks Construct Editor hover/scroll/selection/reload events into the new tooltip.
Comments suppressed due to low confidence (2)

construct_editor/wx_widgets/wx_construct_editor.py:571

  • When hovering a non-tooltip column, _on_dvc_motion returns without clearing the previous tooltip state. This can leave an unrelated tooltip visible until the poll timer hides it. Explicitly hiding here avoids showing stale tooltip content while moving across columns.
        else:
            return

construct_editor/wx_widgets/wx_construct_editor.py:574

  • If the resolved tooltip text is empty, _on_dvc_motion returns without hiding the existing tooltip. That can leave the last non-empty tooltip visible even though the current cell has no tooltip content. Hiding here prevents stale tooltips.
        if not text:
            return

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/wx_integration/wx_test_helpers.py
Comment thread construct_editor/wx_widgets/wx_hover_tooltip.py
Comment thread construct_editor/wx_widgets/wx_hover_tooltip.py Outdated
Comment thread construct_editor/wx_widgets/wx_construct_editor.py
@timrid
timrid merged commit 5b62b18 into main Jul 30, 2026
14 of 15 checks passed
@timrid
timrid deleted the optimized-tooltip branch July 30, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants