From 6680e9adecc295c93f7211131ab788dc0b4c7d8d Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 16 May 2025 08:26:23 +0200 Subject: [PATCH] osd: make brightness icon go speen speen --- .../OnScreenDisplayBrightness.qml | 1 + .../onScreenDisplay/OsdValueIndicator.qml | 33 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.config/quickshell/modules/onScreenDisplay/OnScreenDisplayBrightness.qml b/.config/quickshell/modules/onScreenDisplay/OnScreenDisplayBrightness.qml index 2662985d3..c2038e60e 100644 --- a/.config/quickshell/modules/onScreenDisplay/OnScreenDisplayBrightness.qml +++ b/.config/quickshell/modules/onScreenDisplay/OnScreenDisplayBrightness.qml @@ -104,6 +104,7 @@ Scope { anchors.centerIn: parent value: brightnessMonitor.brightness icon: "light_mode" + rotateIcon: true name: qsTr("Brightness") } } diff --git a/.config/quickshell/modules/onScreenDisplay/OsdValueIndicator.qml b/.config/quickshell/modules/onScreenDisplay/OsdValueIndicator.qml index 63b6609d6..f13cd7fc3 100644 --- a/.config/quickshell/modules/onScreenDisplay/OsdValueIndicator.qml +++ b/.config/quickshell/modules/onScreenDisplay/OsdValueIndicator.qml @@ -13,6 +13,7 @@ Item { required property real value required property string icon required property string name + property bool rotateIcon: false property real valueIndicatorVerticalPadding: 5 property real valueIndicatorLeftPadding: 10 @@ -33,14 +34,38 @@ Item { Layout.margins: 10 spacing: 10 - MaterialSymbol { // Icon + Item { + implicitWidth: 30 + implicitHeight: 30 Layout.alignment: Qt.AlignVCenter Layout.leftMargin: valueIndicatorLeftPadding Layout.topMargin: valueIndicatorVerticalPadding Layout.bottomMargin: valueIndicatorVerticalPadding - color: Appearance.colors.colOnLayer0 - text: root.icon - iconSize: 30 + MaterialSymbol { // Icon + anchors.centerIn: parent + color: Appearance.colors.colOnLayer0 + renderType: Text.QtRendering + + text: root.icon + iconSize: 20 + 10 * (root.rotateIcon ? value : 1) + rotation: 180 * (root.rotateIcon ? value : 0) + + Behavior on iconSize { + NumberAnimation { + duration: Appearance.animation.elementMoveEnter.duration + easing.type: Appearance.animation.elementMoveEnter.type + easing.bezierCurve: Appearance.animation.elementMoveEnter.bezierCurve + } + } + Behavior on rotation { + NumberAnimation { + duration: Appearance.animation.elementMoveEnter.duration + easing.type: Appearance.animation.elementMoveEnter.type + easing.bezierCurve: Appearance.animation.elementMoveEnter.bezierCurve + } + } + + } } ColumnLayout { // Stuff Layout.alignment: Qt.AlignVCenter