Skip to content

fix: update tooltip window property bindings and hover behavior#1549

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-296251
Apr 9, 2026
Merged

fix: update tooltip window property bindings and hover behavior#1549
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-296251

Conversation

@wjyrich

@wjyrich wjyrich commented Apr 9, 2026

Copy link
Copy Markdown
Contributor
  1. Changed tooltip window property bindings from "width"/"height" to "requestedWidth"/"requestedHeight" in PanelToolTip.qml
  2. Added tooltip close functionality when quick panel is opened in PanelTrayItem.qml
  3. Removed hover handler enabled condition to ensure consistent hover behavior

The changes update tooltip property bindings to use more appropriate property names ("requestedWidth"/"requestedHeight") which better reflect their purpose. Also fixes tooltip behavior by closing it when the quick panel opens, preventing tooltips from remaining visible when they shouldn't be. The hover handler condition removal ensures hover detection works consistently regardless of panel state.

Log: Fixed tooltip behavior in quick panel - tooltips now properly close when panel opens

Influence:

  1. Test tooltip display when hovering over quick panel icon
  2. Verify tooltip disappears when quick panel is opened
  3. Check tooltip positioning and sizing with different content
  4. Test hover behavior consistency when panel is open/closed
  5. Verify no visual artifacts or overlapping elements

fix: 更新工具提示窗口属性绑定和悬停行为

  1. 在 PanelToolTip.qml 中将工具提示窗口属性绑定从 "width"/"height" 改为 "requestedWidth"/"requestedHeight"
  2. 在 PanelTrayItem.qml 中添加快速面板打开时关闭工具提示的功能
  3. 移除悬停处理器的启用条件以确保一致的悬停行为

这些更改将工具提示属性绑定更新为使用更合适的属性名称
("requestedWidth"/"requestedHeight"),更好地反映其用途。同时修复了工具 提示行为,在快速面板打开时关闭工具提示,防止工具提示在不应该显示时仍然可
见。移除悬停处理器条件可确保悬停检测无论面板状态如何都能一致工作。

Log: 修复快速面板中的工具提示行为 - 面板打开时工具提示现在能正确关闭

Influence:

  1. 测试悬停在快速面板图标上时工具提示的显示
  2. 验证打开快速面板时工具提示是否消失
  3. 检查不同内容下工具提示的定位和大小调整
  4. 测试面板打开/关闭时的悬停行为一致性
  5. 验证没有视觉伪影或元素重叠

PMS: BUG-296251

Summary by Sourcery

Align tooltip sizing and visibility behavior for quick panel items to ensure consistent hover interaction and correct closing when the panel opens.

Bug Fixes:

  • Close quick panel tooltips automatically when the panel is opened to avoid lingering tooltips.
  • Ensure hover detection and tooltip activation remain consistent regardless of the panel open state.
  • Use the tooltip window's requested size properties to better match tooltip content and padding, preventing sizing issues.

Enhancements:

  • Update tooltip window bindings to use requested size properties that better represent intended layout behavior.

@sourcery-ai

sourcery-ai Bot commented Apr 9, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR adjusts tooltip sizing bindings to use requested dimensions, ensures quick panel tooltips close when the panel opens, and simplifies hover handling to make hover behavior consistent regardless of panel state.

Sequence diagram for updated quick panel tooltip behavior

sequenceDiagram
    actor User
    participant PanelTrayItem
    participant HoverHandler
    participant PanelToolTip
    participant ToolTipWindow
    participant QuickPanel

    User->>HoverHandler: pointer enters icon area
    HoverHandler->>PanelTrayItem: onHoveredChanged(hovered = true)
    PanelTrayItem->>PanelToolTip: open tooltip when !isOpened
    PanelToolTip->>PanelToolTip: calculate width and height
    PanelToolTip->>ToolTipWindow: set requestedWidth
    PanelToolTip->>ToolTipWindow: set requestedHeight
    ToolTipWindow-->>User: display tooltip

    User->>QuickPanel: open quick panel
    QuickPanel->>PanelTrayItem: set isOpened = true
    PanelTrayItem->>PanelTrayItem: onIsOpenedChanged
    PanelTrayItem->>PanelToolTip: toolTip.close()
    PanelToolTip->>ToolTipWindow: close window
    ToolTipWindow-->>User: hide tooltip

    User->>HoverHandler: pointer moves while panel open
    HoverHandler->>PanelTrayItem: onHoveredChanged(hovered changes)
    PanelTrayItem->>PanelToolTip: do not reopen tooltip when isOpened = true
Loading

Class diagram for updated PanelToolTip and PanelTrayItem

classDiagram
    class PanelTrayItem {
        bool isOpened
        bool contentHovered
        PanelToolTip toolTip
        void onIsOpenedChanged()
        void onHoveredChanged(bool hovered)
    }

    class PanelToolTip {
        ToolTipWindow toolTipWindow
        double width
        double height
        double leftPadding
        double rightPadding
        bool readyBinding
        void bindRequestedWidth()
        void bindRequestedHeight()
    }

    class ToolTipWindow {
        double requestedWidth
        double requestedHeight
        void close()
    }

    class HoverHandler {
        void onHoveredChanged(bool hovered)
    }

    PanelTrayItem --> PanelToolTip : contains
    PanelToolTip --> ToolTipWindow : configures
    PanelTrayItem --> HoverHandler : uses
    HoverHandler --> PanelTrayItem : notifies hover state

    PanelToolTip : bindRequestedWidth() uses toolTipWindow.requestedWidth
    PanelToolTip : bindRequestedHeight() uses toolTipWindow.requestedHeight
    PanelTrayItem : onIsOpenedChanged() calls toolTip.close()
    PanelTrayItem : onHoveredChanged() shows tooltip only when !isOpened
Loading

File-Level Changes

Change Details Files
Update tooltip window sizing to use requestedWidth/requestedHeight instead of width/height.
  • Change bindings for tooltip window width to bind to requestedWidth based on tooltip content width and horizontal padding.
  • Change bindings for tooltip window height to bind to requestedHeight based on tooltip content height.
frame/qml/PanelToolTip.qml
Align tooltip behavior with quick panel open/close state and simplify hover handling.
  • Add onIsOpenedChanged handler to close the tooltip when the quick panel opens.
  • Remove the enabled condition from HoverHandler so hover detection runs regardless of panel open state, while keeping the logic that only opens the panel when hovered and currently closed.
panels/dock/tray/quickpanel/PanelTrayItem.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

yixinshark
yixinshark previously approved these changes Apr 9, 2026
1. Changed tooltip window property bindings from "width"/"height" to
"requestedWidth"/"requestedHeight" in PanelToolTip.qml
2. Added tooltip close functionality when quick panel is opened in
PanelTrayItem.qml
3. Removed hover handler enabled condition to ensure consistent hover
behavior

The changes update tooltip property bindings to use more appropriate
property names ("requestedWidth"/"requestedHeight") which better
reflect their purpose. Also fixes tooltip behavior by closing it when
the quick panel opens, preventing tooltips from remaining visible when
they shouldn't be. The hover handler condition removal ensures hover
detection works consistently regardless of panel state.

Log: Fixed tooltip behavior in quick panel - tooltips now properly close
when panel opens

Influence:
1. Test tooltip display when hovering over quick panel icon
2. Verify tooltip disappears when quick panel is opened
3. Check tooltip positioning and sizing with different content
4. Test hover behavior consistency when panel is open/closed
5. Verify no visual artifacts or overlapping elements

fix: 更新工具提示窗口属性绑定和悬停行为

1. 在 PanelToolTip.qml 中将工具提示窗口属性绑定从 "width"/"height" 改为
"requestedWidth"/"requestedHeight"
2. 在 PanelTrayItem.qml 中添加快速面板打开时关闭工具提示的功能
3. 移除悬停处理器的启用条件以确保一致的悬停行为

这些更改将工具提示属性绑定更新为使用更合适的属性名称
("requestedWidth"/"requestedHeight"),更好地反映其用途。同时修复了工具
提示行为,在快速面板打开时关闭工具提示,防止工具提示在不应该显示时仍然可
见。移除悬停处理器条件可确保悬停检测无论面板状态如何都能一致工作。

Log: 修复快速面板中的工具提示行为 - 面板打开时工具提示现在能正确关闭

Influence:
1. 测试悬停在快速面板图标上时工具提示的显示
2. 验证打开快速面板时工具提示是否消失
3. 检查不同内容下工具提示的定位和大小调整
4. 测试面板打开/关闭时的悬停行为一致性
5. 验证没有视觉伪影或元素重叠

PMS: BUG-296251
@wjyrich wjyrich force-pushed the fix-bug-296251 branch 2 times, most recently from 6194b42 to 68f5079 Compare April 9, 2026 11:52
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wjyrich, yixinshark

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wjyrich

wjyrich commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Apr 9, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit ad57bb4 into linuxdeepin:master Apr 9, 2026
7 checks passed
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