From aebd3235d755cb1ff95995b461e497fea2d52e8b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 11 Sep 2025 14:43:11 +0200 Subject: ... --- .../shell/quickshell/BrightnessWidget.qml | 47 +++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml') diff --git a/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml b/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml index 664b28e2..7f9c1ad0 100644 --- a/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml +++ b/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml @@ -5,7 +5,7 @@ import qs.Services Item { height: parent.height - width: brightnessIcon.width + width: brightnessIcon.width + 8 anchors.verticalCenter: parent.verticalCenter WrapperMouseArea { @@ -13,6 +13,8 @@ Item { anchors.fill: parent + hoverEnabled: true + property real sensitivity: (1 / 50) / 120 onWheel: event => Brightness.currBrightness += event.angleDelta.y * sensitivity @@ -30,4 +32,47 @@ Item { } } } + + PopupWindow { + id: tooltip + + property bool nextVisible: widgetMouseArea.containsMouse || tooltipMouseArea.containsMouse + + anchor { + item: widgetMouseArea + edges: Edges.Bottom | Edges.Left + } + visible: false + + onNextVisibleChanged: hangTimer.restart() + + Timer { + id: hangTimer + interval: 100 + onTriggered: tooltip.visible = tooltip.nextVisible + } + + implicitWidth: widgetTooltipText.contentWidth + 16 + implicitHeight: widgetTooltipText.contentHeight + 16 + color: "black" + + WrapperMouseArea { + id: tooltipMouseArea + + hoverEnabled: true + enabled: true + + anchors.centerIn: parent + + Text { + id: widgetTooltipText + + font.pointSize: 10 + font.family: "Fira Sans" + color: "white" + + text: `${Math.round(Brightness.currBrightness * 100)}%` + } + } + } } -- cgit v1.2.3