Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
starhcq opened this issue Sep 20, 2024 · 0 comments

Comments

@starhcq
Copy link

starhcq commented Sep 20, 2024

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

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

No branches or pull requests

1 participant