From b75a2a12c752162af728bc0cd40a007956881545 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Wed, 27 Aug 2025 09:49:16 -0400 Subject: [PATCH] styled tooltip --- components/StyledToolTip.qml | 19 +++++++++++++++++++ modules/storybook/Storybook.qml | 12 +++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 components/StyledToolTip.qml diff --git a/components/StyledToolTip.qml b/components/StyledToolTip.qml new file mode 100644 index 0000000..0c09a95 --- /dev/null +++ b/components/StyledToolTip.qml @@ -0,0 +1,19 @@ +import qs.config +import QtQuick +import QtQuick.Controls + +ToolTip { + id: control + text: qsTr("A descriptive tool tip of what the button does") + + contentItem: Text { + text: control.text + font: control.font + color: Theme.palette.basecontent + } + + background: Rectangle { + radius: 8 + color: Theme.palette.base200 + } +} diff --git a/modules/storybook/Storybook.qml b/modules/storybook/Storybook.qml index 6334ec2..d0d91cb 100644 --- a/modules/storybook/Storybook.qml +++ b/modules/storybook/Storybook.qml @@ -8,6 +8,7 @@ import Quickshell.Hyprland import Quickshell.Wayland import Quickshell.Widgets import QtQuick +import QtQuick.Controls import QtQuick.Layouts StyledWindow { @@ -39,6 +40,15 @@ StyledWindow { } } - ColumnLayout {} + ColumnLayout { + Button { + id: toolTipButton + text: "Hello world!" + StyledToolTip { + visible: toolTipButton.hovered + text: qsTr("Save the active project") + } + } + } } }