From a46c76b9d54c12797ba8d9ddafc0410dd9e62413 Mon Sep 17 00:00:00 2001 From: loner <2788892716@qq.com> Date: Mon, 17 Nov 2025 09:45:43 +0800 Subject: [PATCH] feat(bar): Add capsule opacity setting with conditional slider in bar settings --- Assets/Translations/en.json | 4 +++ Assets/settings-default.json | 1 + Commons/Settings.qml | 1 + Modules/Bar/Extras/BarPillHorizontal.qml | 4 +-- Modules/Bar/Extras/BarPillVertical.qml | 4 +-- Modules/Bar/Widgets/ActiveWindow.qml | 2 +- Modules/Bar/Widgets/AudioVisualizer.qml | 2 +- Modules/Bar/Widgets/Clock.qml | 2 +- Modules/Bar/Widgets/ControlCenter.qml | 2 +- Modules/Bar/Widgets/DarkMode.qml | 2 +- Modules/Bar/Widgets/LockKeys.qml | 2 +- Modules/Bar/Widgets/MediaMini.qml | 2 +- Modules/Bar/Widgets/NightLight.qml | 2 +- Modules/Bar/Widgets/NoctaliaPerformance.qml | 2 +- Modules/Bar/Widgets/NotificationHistory.qml | 2 +- Modules/Bar/Widgets/PowerProfile.qml | 2 +- Modules/Bar/Widgets/ScreenRecorder.qml | 2 +- Modules/Bar/Widgets/SessionMenu.qml | 2 +- Modules/Bar/Widgets/SystemMonitor.qml | 2 +- Modules/Bar/Widgets/Taskbar.qml | 2 +- Modules/Bar/Widgets/TaskbarGrouped.qml | 2 +- Modules/Bar/Widgets/Tray.qml | 6 ++--- Modules/Bar/Widgets/WallpaperSelector.qml | 2 +- Modules/Bar/Widgets/Workspace.qml | 2 +- Modules/Panels/Settings/Tabs/BarTab.qml | 30 +++++++++++++++++++++ 25 files changed, 61 insertions(+), 25 deletions(-) diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index e1d7f25bc..3b1aee6e1 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -818,6 +818,10 @@ "show-capsule": { "description": "Show widget backgrounds.", "label": "Show capsule" + }, + "capsule-opacity": { + "description": "Set the opacity level for widget backgrounds when capsule is shown.", + "label": "Capsule opacity" } }, "monitors": { diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 01b1188ac..f3afbe310 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -7,6 +7,7 @@ "monitors": [], "density": "default", "showCapsule": true, + "capsuleOpacity": 1.0, "floating": false, "marginVertical": 0.25, "marginHorizontal": 0.25, diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 0607b16aa..d549f4704 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -141,6 +141,7 @@ Singleton { property list monitors: [] property string density: "default" // "compact", "default", "comfortable" property bool showCapsule: true + property real capsuleOpacity: 1.0 // Floating bar settings property bool floating: false diff --git a/Modules/Bar/Extras/BarPillHorizontal.qml b/Modules/Bar/Extras/BarPillHorizontal.qml index b799884a3..145631b5a 100644 --- a/Modules/Bar/Extras/BarPillHorizontal.qml +++ b/Modules/Bar/Extras/BarPillHorizontal.qml @@ -82,7 +82,7 @@ Item { (iconCircle.x + iconCircle.width / 2) - width // Opens left opacity: revealed ? Style.opacityFull : Style.opacityNone - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent readonly property int halfPillHeight: Math.round(pillHeight * 0.5) @@ -135,7 +135,7 @@ Item { width: pillHeight height: pillHeight radius: width * 0.5 - color: hovered ? Color.mHover : Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: hovered ? Color.mHover : Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent anchors.verticalCenter: parent.verticalCenter x: oppositeDirection ? 0 : (parent.width - width) diff --git a/Modules/Bar/Extras/BarPillVertical.qml b/Modules/Bar/Extras/BarPillVertical.qml index db5de0288..b30660f04 100644 --- a/Modules/Bar/Extras/BarPillVertical.qml +++ b/Modules/Bar/Extras/BarPillVertical.qml @@ -94,7 +94,7 @@ Item { y: openUpward ? (iconCircle.y + iconCircle.height / 2 - height) : (iconCircle.y + iconCircle.height / 2) opacity: revealed ? Style.opacityFull : Style.opacityNone - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent readonly property int halfButtonSize: Math.round(buttonSize * 0.5) @@ -158,7 +158,7 @@ Item { width: buttonSize height: buttonSize radius: width * 0.5 - color: hovered ? Color.mHover : Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: hovered ? Color.mHover : Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent // Icon positioning based on direction x: 0 diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index 6d17d4c4b..712a537c8 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -173,7 +173,7 @@ Item { width: isVerticalBar ? ((!hasFocusedWindow) && hideMode === "hidden" ? 0 : calculatedVerticalDimension()) : ((!hasFocusedWindow) && (hideMode === "hidden") ? 0 : dynamicWidth) height: isVerticalBar ? ((!hasFocusedWindow) && hideMode === "hidden" ? 0 : calculatedVerticalDimension()) : Style.capsuleHeight radius: isVerticalBar ? width / 2 : Style.radiusM - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent // Smooth width transition Behavior on width { diff --git a/Modules/Bar/Widgets/AudioVisualizer.qml b/Modules/Bar/Widgets/AudioVisualizer.qml index 2bedeee24..e84c149ac 100644 --- a/Modules/Bar/Widgets/AudioVisualizer.qml +++ b/Modules/Bar/Widgets/AudioVisualizer.qml @@ -74,7 +74,7 @@ Item { id: background anchors.fill: parent radius: Style.radiusS - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent } // Store visualizer type to force re-evaluation diff --git a/Modules/Bar/Widgets/Clock.qml b/Modules/Bar/Widgets/Clock.qml index 19f6f7546..adde48acc 100644 --- a/Modules/Bar/Widgets/Clock.qml +++ b/Modules/Bar/Widgets/Clock.qml @@ -46,7 +46,7 @@ Rectangle { implicitHeight: isBarVertical ? Math.round(verticalLoader.implicitHeight + Style.marginS * 2) : Style.capsuleHeight radius: Style.radiusS - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent Item { id: clockContainer diff --git a/Modules/Bar/Widgets/ControlCenter.qml b/Modules/Bar/Widgets/ControlCenter.qml index 8859b23e6..de5599e8d 100644 --- a/Modules/Bar/Widgets/ControlCenter.qml +++ b/Modules/Bar/Widgets/ControlCenter.qml @@ -45,7 +45,7 @@ NIconButton { baseSize: Style.capsuleHeight applyUiScale: false density: Settings.data.bar.density - colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) + colorBg: (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) colorFg: Color.mOnSurface colorBgHover: useDistroLogo ? Color.mSurfaceVariant : Color.mHover colorBorder: Color.transparent diff --git a/Modules/Bar/Widgets/DarkMode.qml b/Modules/Bar/Widgets/DarkMode.qml index 79bd99f47..9dbe62016 100644 --- a/Modules/Bar/Widgets/DarkMode.qml +++ b/Modules/Bar/Widgets/DarkMode.qml @@ -14,7 +14,7 @@ NIconButton { density: Settings.data.bar.density baseSize: Style.capsuleHeight applyUiScale: false - colorBg: Settings.data.colorSchemes.darkMode ? (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) : Color.mPrimary + colorBg: Settings.data.colorSchemes.darkMode ? (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) : Color.mPrimary colorFg: Settings.data.colorSchemes.darkMode ? Color.mOnSurface : Color.mOnPrimary colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/LockKeys.qml b/Modules/Bar/Widgets/LockKeys.qml index 834473f45..840c18644 100644 --- a/Modules/Bar/Widgets/LockKeys.qml +++ b/Modules/Bar/Widgets/LockKeys.qml @@ -45,7 +45,7 @@ Rectangle { Layout.alignment: Qt.AlignVCenter radius: Style.radiusM - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent Item { id: layout diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 255db3b8a..5d0aac89a 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -170,7 +170,7 @@ Item { width: isVerticalBar ? ((shouldHideIdle || isEmptyForHideMode) ? 0 : calculatedVerticalDimension()) : ((shouldHideIdle || isEmptyForHideMode) ? 0 : dynamicWidth) height: isVerticalBar ? ((shouldHideIdle || isEmptyForHideMode) ? 0 : calculatedVerticalDimension()) : Style.capsuleHeight radius: isVerticalBar ? width / 2 : Style.radiusM - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent // Smooth width transition Behavior on width { diff --git a/Modules/Bar/Widgets/NightLight.qml b/Modules/Bar/Widgets/NightLight.qml index 3d1267849..a535544cd 100644 --- a/Modules/Bar/Widgets/NightLight.qml +++ b/Modules/Bar/Widgets/NightLight.qml @@ -17,7 +17,7 @@ NIconButton { density: Settings.data.bar.density baseSize: Style.capsuleHeight applyUiScale: false - colorBg: Settings.data.nightLight.forced ? Color.mPrimary : (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) + colorBg: Settings.data.nightLight.forced ? Color.mPrimary : (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) colorFg: Settings.data.nightLight.forced ? Color.mOnPrimary : Color.mOnSurface colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/NoctaliaPerformance.qml b/Modules/Bar/Widgets/NoctaliaPerformance.qml index 1cd2d0339..9acbcfd6f 100644 --- a/Modules/Bar/Widgets/NoctaliaPerformance.qml +++ b/Modules/Bar/Widgets/NoctaliaPerformance.qml @@ -17,7 +17,7 @@ NIconButton { density: Settings.data.bar.density baseSize: Style.capsuleHeight applyUiScale: false - colorBg: PowerProfileService.noctaliaPerformanceMode ? Color.mPrimary : (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) + colorBg: PowerProfileService.noctaliaPerformanceMode ? Color.mPrimary : (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) colorFg: PowerProfileService.noctaliaPerformanceMode ? Color.mOnPrimary : Color.mOnSurface colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/NotificationHistory.qml b/Modules/Bar/Widgets/NotificationHistory.qml index 2c39d356a..6cf49f147 100644 --- a/Modules/Bar/Widgets/NotificationHistory.qml +++ b/Modules/Bar/Widgets/NotificationHistory.qml @@ -51,7 +51,7 @@ NIconButton { icon: NotificationService.doNotDisturb ? "bell-off" : "bell" tooltipText: NotificationService.doNotDisturb ? I18n.tr("tooltips.open-notification-history-disable-dnd") : I18n.tr("tooltips.open-notification-history-enable-dnd") tooltipDirection: BarService.getTooltipDirection() - colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) + colorBg: (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) colorFg: Color.mOnSurface colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/PowerProfile.qml b/Modules/Bar/Widgets/PowerProfile.qml index 724d7a4d1..822304ad7 100644 --- a/Modules/Bar/Widgets/PowerProfile.qml +++ b/Modules/Bar/Widgets/PowerProfile.qml @@ -21,7 +21,7 @@ NIconButton { "profile": PowerProfileService.getName() }) tooltipDirection: BarService.getTooltipDirection() - colorBg: (PowerProfileService.profile === PowerProfile.Balanced) ? (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) : Color.mPrimary + colorBg: (PowerProfileService.profile === PowerProfile.Balanced) ? (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) : Color.mPrimary colorFg: (PowerProfileService.profile === PowerProfile.Balanced) ? Color.mOnSurface : Color.mOnPrimary colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/ScreenRecorder.qml b/Modules/Bar/Widgets/ScreenRecorder.qml index dcd058466..f2ce17246 100644 --- a/Modules/Bar/Widgets/ScreenRecorder.qml +++ b/Modules/Bar/Widgets/ScreenRecorder.qml @@ -17,7 +17,7 @@ NIconButton { density: Settings.data.bar.density baseSize: Style.capsuleHeight applyUiScale: false - colorBg: ScreenRecorderService.isRecording ? Color.mPrimary : (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) + colorBg: ScreenRecorderService.isRecording ? Color.mPrimary : (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) colorFg: ScreenRecorderService.isRecording ? Color.mOnPrimary : Color.mOnSurface colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/SessionMenu.qml b/Modules/Bar/Widgets/SessionMenu.qml index d6971af50..9d03a0b73 100644 --- a/Modules/Bar/Widgets/SessionMenu.qml +++ b/Modules/Bar/Widgets/SessionMenu.qml @@ -51,7 +51,7 @@ NIconButton { icon: "power" tooltipText: I18n.tr("tooltips.session-menu") tooltipDirection: BarService.getTooltipDirection() - colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) + colorBg: (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) colorFg: root.iconColor colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index 764444097..71a5fe0e6 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -108,7 +108,7 @@ Rectangle { implicitWidth: isVertical ? Style.capsuleHeight : Math.round(mainGrid.implicitWidth + Style.marginM * 2) implicitHeight: isVertical ? Math.round(mainGrid.implicitHeight + Style.marginM * 2) : Style.capsuleHeight radius: Style.radiusM - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent // Status indicator component definition Component { diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index 8891f64a4..88de12fd4 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -90,7 +90,7 @@ Rectangle { implicitWidth: visible ? (isVerticalBar ? Style.capsuleHeight : Math.round(taskbarLayout.implicitWidth + Style.marginM * 2)) : 0 implicitHeight: visible ? (isVerticalBar ? Math.round(taskbarLayout.implicitHeight + Style.marginM * 2) : Style.capsuleHeight) : 0 radius: Style.radiusM - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent GridLayout { id: taskbarLayout diff --git a/Modules/Bar/Widgets/TaskbarGrouped.qml b/Modules/Bar/Widgets/TaskbarGrouped.qml index 17ea3a909..f8bdaf1f8 100644 --- a/Modules/Bar/Widgets/TaskbarGrouped.qml +++ b/Modules/Bar/Widgets/TaskbarGrouped.qml @@ -211,7 +211,7 @@ Item { border.width: 1 width: (hasWindows ? iconsFlow.implicitWidth : root.itemSize * 0.8) + (root.isVerticalBar ? Style.marginXS : Style.marginL) height: (hasWindows ? iconsFlow.implicitHeight : root.itemSize * 0.8) + (root.isVerticalBar ? Style.marginL : Style.marginXS) - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent MouseArea { anchors.fill: parent diff --git a/Modules/Bar/Widgets/Tray.qml b/Modules/Bar/Widgets/Tray.qml index 10a0da586..cc140bf33 100644 --- a/Modules/Bar/Widgets/Tray.qml +++ b/Modules/Bar/Widgets/Tray.qml @@ -225,7 +225,7 @@ Rectangle { implicitWidth: isVertical ? Style.capsuleHeight : Math.round(trayFlow.implicitWidth) implicitHeight: isVertical ? Math.round(trayFlow.implicitHeight) : Style.capsuleHeight radius: Style.radiusM - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent Flow { id: trayFlow @@ -241,7 +241,7 @@ Rectangle { density: Settings.data.bar.density baseSize: Style.capsuleHeight applyUiScale: false - colorBg: Settings.data.colorSchemes.darkMode ? (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) : Color.mPrimary + colorBg: Settings.data.colorSchemes.darkMode ? (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) : Color.mPrimary colorFg: Settings.data.colorSchemes.darkMode ? Color.mOnSurface : Color.mOnPrimary colorBorder: Color.transparent colorBorderHover: Color.transparent @@ -396,7 +396,7 @@ Rectangle { density: Settings.data.bar.density baseSize: Style.capsuleHeight applyUiScale: false - colorBg: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + colorBg: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent colorFg: Color.mOnSurface colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/WallpaperSelector.qml b/Modules/Bar/Widgets/WallpaperSelector.qml index 1593cbc5b..2b8455d70 100644 --- a/Modules/Bar/Widgets/WallpaperSelector.qml +++ b/Modules/Bar/Widgets/WallpaperSelector.qml @@ -16,7 +16,7 @@ NIconButton { icon: "wallpaper-selector" tooltipText: I18n.tr("tooltips.open-wallpaper-selector") tooltipDirection: BarService.getTooltipDirection() - colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) + colorBg: (Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent) colorFg: Color.mOnSurface colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 37a97cf17..bc09f2660 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -225,7 +225,7 @@ Item { width: isVertical ? Style.capsuleHeight : parent.width height: isVertical ? parent.height : Style.capsuleHeight radius: Style.radiusM - color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent + color: Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter diff --git a/Modules/Panels/Settings/Tabs/BarTab.qml b/Modules/Panels/Settings/Tabs/BarTab.qml index 5ba61a057..01ef03788 100644 --- a/Modules/Panels/Settings/Tabs/BarTab.qml +++ b/Modules/Panels/Settings/Tabs/BarTab.qml @@ -89,6 +89,36 @@ ColumnLayout { onToggled: checked => Settings.data.bar.showCapsule = checked } + ColumnLayout { + Layout.fillWidth: true + spacing: Style.marginXXS + visible: Settings.data.bar.showCapsule + + NText { + text: I18n.tr("settings.bar.appearance.capsule-opacity.label") + pointSize: Style.fontSizeS + font.weight: Style.fontWeightMedium + color: Color.mOnSurface + } + + NText { + text: I18n.tr("settings.bar.appearance.capsule-opacity.description") + pointSize: Style.fontSizeXS + color: Color.mOnSurfaceVariant + wrapMode: Text.WordWrap + } + + NValueSlider { + Layout.fillWidth: true + from: 0 + to: 1 + stepSize: 0.01 + value: Settings.data.bar.capsuleOpacity + onMoved: value => Settings.data.bar.capsuleOpacity = value + text: Math.floor(Settings.data.bar.capsuleOpacity * 100) + "%" + } + } + NToggle { Layout.fillWidth: true label: I18n.tr("settings.bar.appearance.floating.label")