Skip to content

[dtk6declarative] ToolButton放置在TitleBar内没有悬停效果和悬浮提示 #198

Description

@starhcq

SUMMARY | 问题概要

1.添加一个ToolButton到标题栏的TitleBar中,鼠标悬停到ToolButton上,没有悬停效果,也没有悬浮提示;
2.添加一个ToolButton到窗体主界面中,鼠标悬停到ToolButton上,有悬停效果,也有悬浮提示。

DTK and OS VERSIONS | DTK&系统版本信息

Distribution: v25 0809
Pacakge: dtk6declarative 6.0.19

Minimal Reproducible Case Code | 最小复现案例代码

Demo:
ToolButtonTest.zip
添加一个ToolButton到标题栏Preload.qml,示例代码:

header: TitleBar {
        ToolButton {
            property int iconSize: 36
            id: showHideleftSidebarButton
            anchors.left: parent.left
            width : iconSize
            height : iconSize
            icon {
                name: "checked"
                width: iconSize
                height: iconSize
            }
            ToolTip.visible: hovered
            ToolTip.text: qsTr("Hide side pane")
            onClicked :{
                console.log("toolbutton clicked.")
            }
        }
    }

添加一个ToolButton到主界面main.qml,示例代码如下:

Component {
        ToolButton {
            property int iconSize: 36
            id: showHideleftSidebarButton
            anchors.centerIn: parent
            width : iconSize
            height : iconSize
            icon {
                name: "checked"
                width: iconSize
                height: iconSize
            }
            ToolTip.visible: hovered
            ToolTip.text: qsTr("Hide side pane")
            onClicked :{
                console.log("toolbutton clicked.")
            }
        }
    }

OBSERVED RESULT | 观察到的结果

截图_ToolButtonTest_20240920112805

EXPECTED RESULT | 期望的结果

ToolButton放置到标题栏内,鼠标移动其上,能正常显示悬停效果和悬浮提示。

ADDITIONAL INFORMATION | 额外补充

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions