From c8450b44cb238a9aa52df095e672ae54d524f487 Mon Sep 17 00:00:00 2001 From: SomeElse Date: Thu, 14 May 2026 20:32:19 +0000 Subject: [PATCH] added option to disable animations for some modules --- bar/modules/Clock.qml | 4 ++-- bar/modules/Notifications.qml | 4 ++-- bar/modules/Volume.qml | 2 +- config/config.qml | 13 +++++++++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bar/modules/Clock.qml b/bar/modules/Clock.qml index 6d21977..c8fe781 100644 --- a/bar/modules/Clock.qml +++ b/bar/modules/Clock.qml @@ -118,9 +118,9 @@ Rectangle { font.bold: true verticalAlignment: Text.AlignVCenter - opacity: (hoverHandler.hovered || calendarPopup.popupOpen) ? 1.0 : 0.0 + opacity: (hoverHandler.hovered || calendarPopup.popupOpen) && Cfg.Config.clockExtendEnabled ? 1.0 : 0.0 visible: opacity > 0 - Layout.preferredWidth: (hoverHandler.hovered || calendarPopup.popupOpen) ? implicitWidth : 0 + Layout.preferredWidth: (hoverHandler.hovered || calendarPopup.popupOpen) && Cfg.Config.clockExtendEnabled ? implicitWidth : 0 clip: true Behavior on opacity { NumberAnimation { duration: 200 } } diff --git a/bar/modules/Notifications.qml b/bar/modules/Notifications.qml index b65a56c..61b2a36 100644 --- a/bar/modules/Notifications.qml +++ b/bar/modules/Notifications.qml @@ -317,7 +317,7 @@ Rectangle { } } - HoverHandler { id: hoverHandler; cursorShape: Qt.PointingHandCursor; onHoveredChanged: if (hovered) bellRingAnim.start() } + HoverHandler { id: hoverHandler; cursorShape: Qt.PointingHandCursor; onHoveredChanged: if (hovered && Cfg.Config.notificationShakeEnabled) bellRingAnim.start() } TapHandler { onTapped: { if (historyPopup.popupOpen) { @@ -414,7 +414,7 @@ Rectangle { onNotification: function(notif) { notif.tracked = true - bellRingAnim.start() + if (Cfg.Config.notificationShakeEnabled) bellRingAnim.start() const timeStr = new Date().toLocaleTimeString(Qt.locale(), "HH:mm") const toastId = notif.id + "_" + Date.now() diff --git a/bar/modules/Volume.qml b/bar/modules/Volume.qml index cd59c6b..d6da043 100644 --- a/bar/modules/Volume.qml +++ b/bar/modules/Volume.qml @@ -137,7 +137,7 @@ Rectangle { id: hoverHandler cursorShape: Qt.PointingHandCursor onHoveredChanged: { - if (hovered) shakeAnim.restart() + if (hovered && Cfg.Config.volumeShakeEnabled) shakeAnim.restart() } } TapHandler { onTapped: volumePopup.toggle() } diff --git a/config/config.qml b/config/config.qml index 4136ea7..e83b585 100644 --- a/config/config.qml +++ b/config/config.qml @@ -6,7 +6,7 @@ import "themes" QtObject { id: root - readonly property var theme: Tropicalnight + readonly property var theme: Goldencity // ──────────────────────────────────────────────────────────────────────── // Widgets @@ -43,7 +43,10 @@ QtObject { property int popupRadius: 18 property int popupBorderWidth: 1 property int popupAnimDuration: 500 - + + // ── Clock Module ───────────────────────────────────────────────────────── + property bool clockExtendEnabled: true // seconds extension on hover for clock + // ── Timezone (IANA name, e.g. "America/New_York", "Europe/London")g ────────── // Leave empty to use the system timezone. property string timezone: "America/New_York" @@ -68,6 +71,7 @@ QtObject { property bool statsStartExpanded: false // ── Volume Module ───────────────────────────────────────────────────────── + property bool volumeShakeEnabled: true // rotation shake for volume chip property int volumeIconSize: 20 property int volumeSliderHeight: 2 property int volumeHandleSize: 20 @@ -75,6 +79,7 @@ QtObject { property int volumeOutputMax: 170 property int volumeInputMax: 200 + // ──────────────────────────────────────────────────────────────────────── // FRAME // ──────────────────────────────────────────────────────────────────────── @@ -83,10 +88,10 @@ QtObject { // ──────────────────────────────────────────────────────────────────────── // NOTIFICATIONS // ──────────────────────────────────────────────────────────────────────── - + property bool notificationShakeEnabled: true // bell ringing shake for notifications property string notificationPosition: "topright" property int notificationHistorySize: 50 - + // ── Toast timeouts (milliseconds) ───────────────────────────────────────── property int notifTimeoutLow: 3500 property int notifTimeoutNormal: 5000