From a4d5a10da917b63763c82e89f3998c38ef112915 Mon Sep 17 00:00:00 2001 From: MichaelThomas0721 Date: Sun, 17 Aug 2025 22:48:41 -0400 Subject: [PATCH] Added background opacity slider to bar settings --- Commons/Settings.qml | 1 + Modules/Bar/Bar.qml | 2 +- Modules/SettingsPanel/Tabs/BarTab.qml | 39 +++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Commons/Settings.qml b/Commons/Settings.qml index eed8bbe..16ef68a 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -78,6 +78,7 @@ Singleton { property bool showBrightness: true property bool showNotificationsHistory: true property bool showTray: true + property real backgroundOpacity: 1.0 property list monitors: [] } diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index 8a2c3f6..cece1e0 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -39,7 +39,7 @@ Variants { id: bar anchors.fill: parent - color: Color.mSurface + color: Qt.rgba(Color.mSurface,Color.mSurface.g,Color.mSurface.b,Settings.data.bar.backgroundOpacity) layer.enabled: true } diff --git a/Modules/SettingsPanel/Tabs/BarTab.qml b/Modules/SettingsPanel/Tabs/BarTab.qml index 9dce857..203cee2 100644 --- a/Modules/SettingsPanel/Tabs/BarTab.qml +++ b/Modules/SettingsPanel/Tabs/BarTab.qml @@ -84,6 +84,45 @@ ColumnLayout { Settings.data.bar.showTray = checked } } + + ColumnLayout { + spacing: Style.marginTiniest * scaling + Layout.fillWidth: true + + NText { + text: "Background Opacity" + font.pointSize: Style.fontSizeLarge * scaling + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + NText { + text: "Adjust the background opacity of the bar" + font.pointSize: Style.fontSizeSmall * scaling + color: Color.mOnSurfaceVariant + wrapMode: Text.WordWrap + Layout.fillWidth: true + } + + RowLayout { + NSlider { + Layout.fillWidth: true + from: 0 + to: 1 + stepSize: 0.01 + value: Settings.data.bar.backgroundOpacity + onMoved: Settings.data.bar.backgroundOpacity = value + cutoutColor: Color.mSurface + } + + NText { + text: Math.floor(Settings.data.bar.backgroundOpacity * 100) + "%" + Layout.alignment: Qt.AlignVCenter + Layout.leftMargin: Style.marginSmall * scaling + color: Color.mOnSurface + } + } + } } } }