diff --git a/modules/BarIcon.qml b/modules/BarIcon.qml index 3d22c14..17c11e3 100644 --- a/modules/BarIcon.qml +++ b/modules/BarIcon.qml @@ -13,7 +13,7 @@ Text { verticalAlignment: Text.AlignVCenter HoverHandler { id: _hover } - ToolTip { + M.BarTooltip { visible: _hover.hovered && parent.tooltip !== "" text: parent.tooltip } diff --git a/modules/BarLabel.qml b/modules/BarLabel.qml index d92d0f3..4f5bc89 100644 --- a/modules/BarLabel.qml +++ b/modules/BarLabel.qml @@ -13,7 +13,7 @@ Text { verticalAlignment: Text.AlignVCenter HoverHandler { id: _hover } - ToolTip { + M.BarTooltip { visible: _hover.hovered && parent.tooltip !== "" text: parent.tooltip } diff --git a/modules/BarSection.qml b/modules/BarSection.qml index 7c9b236..16f5cec 100644 --- a/modules/BarSection.qml +++ b/modules/BarSection.qml @@ -1,11 +1,11 @@ import QtQuick -import QtQuick.Controls +import "." as M Row { property string tooltip: "" HoverHandler { id: _hover } - ToolTip { + M.BarTooltip { visible: _hover.hovered && parent.tooltip !== "" text: parent.tooltip } diff --git a/modules/BarTooltip.qml b/modules/BarTooltip.qml new file mode 100644 index 0000000..f6fe501 --- /dev/null +++ b/modules/BarTooltip.qml @@ -0,0 +1,22 @@ +import QtQuick +import QtQuick.Controls +import "." as M + +ToolTip { + id: tip + padding: 6 + + background: Rectangle { + color: M.Theme.base01 + border.color: M.Theme.base03 + border.width: 1 + radius: 4 + } + + contentItem: Text { + text: tip.text + color: M.Theme.base05 + font.pixelSize: M.Theme.fontSize + font.family: M.Theme.fontFamily + } +} diff --git a/modules/qmldir b/modules/qmldir index 77815c6..0b272ba 100644 --- a/modules/qmldir +++ b/modules/qmldir @@ -2,6 +2,7 @@ module modules singleton Theme 1.0 Theme.qml Bar 1.0 Bar.qml BarSection 1.0 BarSection.qml +BarTooltip 1.0 BarTooltip.qml Workspaces 1.0 Workspaces.qml WindowTitle 1.0 WindowTitle.qml Clock 1.0 Clock.qml