From 5ffbd55f58e661a61e8e538d31714f94fe147773 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 21 Jun 2025 03:24:03 +0200 Subject: [PATCH] settings: bar and audio options --- .../modules/common/widgets/ConfigSwitch.qml | 1 + .../quickshell/modules/overview/Overview.qml | 3 +- .../modules/settings/BehaviorConfig.qml | 15 ++++++- .config/quickshell/modules/settings/Style.qml | 44 ++++++++++++++----- 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/.config/quickshell/modules/common/widgets/ConfigSwitch.qml b/.config/quickshell/modules/common/widgets/ConfigSwitch.qml index 01dda8a2a..51f82a727 100644 --- a/.config/quickshell/modules/common/widgets/ConfigSwitch.qml +++ b/.config/quickshell/modules/common/widgets/ConfigSwitch.qml @@ -8,6 +8,7 @@ RippleButton { id: root Layout.fillWidth: true implicitHeight: contentItem.implicitHeight + 8 * 2 + onClicked: checked = !checked contentItem: RowLayout { spacing: 10 diff --git a/.config/quickshell/modules/overview/Overview.qml b/.config/quickshell/modules/overview/Overview.qml index a7817e6e9..8e33db617 100644 --- a/.config/quickshell/modules/overview/Overview.qml +++ b/.config/quickshell/modules/overview/Overview.qml @@ -92,8 +92,7 @@ Scope { visible: GlobalStates.overviewOpen anchors { horizontalCenter: parent.horizontalCenter - top: !ConfigOptions.bar.bottom ? parent.top : undefined - bottom: ConfigOptions.bar.bottom ? parent.bottom : undefined + top: parent.top } Keys.onPressed: (event) => { diff --git a/.config/quickshell/modules/settings/BehaviorConfig.qml b/.config/quickshell/modules/settings/BehaviorConfig.qml index 9cec75c3d..7fc902122 100644 --- a/.config/quickshell/modules/settings/BehaviorConfig.qml +++ b/.config/quickshell/modules/settings/BehaviorConfig.qml @@ -48,7 +48,18 @@ ContentPage { } } } - - + } + ContentSection { + title: "Audio" + ConfigSwitch { + text: "Earbang protection" + checked: ConfigOptions.audio.protection.enable + onCheckedChanged: { + ConfigLoader.setConfigValueAndSave("audio.protection.enable", checked); + } + StyledToolTip { + content: "Prevents abrupt increments and restricts volume limit" + } + } } } \ No newline at end of file diff --git a/.config/quickshell/modules/settings/Style.qml b/.config/quickshell/modules/settings/Style.qml index 87775072a..50803e168 100644 --- a/.config/quickshell/modules/settings/Style.qml +++ b/.config/quickshell/modules/settings/Style.qml @@ -174,15 +174,41 @@ ContentPage { } } - ConfigSwitch { - text: "Transparency" - checked: ConfigOptions.appearance.transparency - onClicked: checked = !checked; - onCheckedChanged: { - ConfigLoader.setConfigValueAndSave("appearance.transparency", checked); + ConfigRow { + ConfigSwitch { + text: "Transparency" + checked: ConfigOptions.appearance.transparency + onCheckedChanged: { + ConfigLoader.setConfigValueAndSave("appearance.transparency", checked); + } + StyledToolTip { + content: "Might look ass. Unsupported." + } } - StyledToolTip { - content: "Might look ass. Unsupported." + } + + StyledText { + text: "Bar" + color: Appearance.colors.colSubtext + } + ConfigRow { + uniform: true + ConfigSwitch { + text: 'Borderless' + checked: ConfigOptions.bar.borderless + onCheckedChanged: { + ConfigLoader.setConfigValueAndSave("bar.borderless", checked); + } + } + ConfigSwitch { + text: 'Show background' + checked: ConfigOptions.bar.showBackground + onCheckedChanged: { + ConfigLoader.setConfigValueAndSave("bar.showBackground", checked); + } + StyledToolTip { + content: "Note: turning off can hurt readability" + } } } } @@ -196,7 +222,6 @@ ContentPage { ConfigSwitch { text: "Title bar" checked: ConfigOptions.windows.showTitlebar - onClicked: checked = !checked; onCheckedChanged: { ConfigLoader.setConfigValueAndSave("windows.showTitlebar", checked); } @@ -204,7 +229,6 @@ ContentPage { ConfigSwitch { text: "Center title" checked: ConfigOptions.windows.centerTitle - onClicked: checked = !checked; onCheckedChanged: { ConfigLoader.setConfigValueAndSave("windows.centerTitle", checked); }