diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index 4227c8bd..f4ab4cc9 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -253,6 +253,7 @@ Singleton { property bool notificationOverlayEnabled: false property bool dankBarAutoHide: false + property int dankBarAutoHideDelay: 250 property bool dankBarOpenOnOverview: false property bool dankBarVisible: true property int overviewRows: 2 @@ -264,6 +265,8 @@ Singleton { property int dankBarPosition: SettingsData.Position.Top property bool dankBarIsVertical: dankBarPosition === SettingsData.Position.Left || dankBarPosition === SettingsData.Position.Right + onDankBarAutoHideDelayChanged: saveSettings() + property bool dankBarSquareCorners: false property bool dankBarNoBackground: false property bool dankBarGothCornersEnabled: false diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index 69979d23..ecbc2c06 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -170,6 +170,7 @@ var SPEC = { notificationOverlayEnabled: { def: false }, dankBarAutoHide: { def: false, migrate: ["topBarAutoHide"] }, + dankBarAutoHideDelay: { def: 250 }, dankBarOpenOnOverview: { def: false, migrate: ["topBarOpenOnOverview"] }, dankBarVisible: { def: true, migrate: ["topBarVisible"] }, overviewRows: { def: 2, persist: false }, diff --git a/quickshell/Modules/DankBar/DankBar.qml b/quickshell/Modules/DankBar/DankBar.qml index f8013f49..234baafd 100644 --- a/quickshell/Modules/DankBar/DankBar.qml +++ b/quickshell/Modules/DankBar/DankBar.qml @@ -399,7 +399,7 @@ Item { Timer { id: revealHold - interval: 250 + interval: SettingsData.dankBarAutoHideDelay repeat: false onTriggered: topBarCore.revealSticky = false } diff --git a/quickshell/Modules/Settings/DankBarTab.qml b/quickshell/Modules/Settings/DankBarTab.qml index 703ee953..1fcbd188 100644 --- a/quickshell/Modules/Settings/DankBarTab.qml +++ b/quickshell/Modules/Settings/DankBarTab.qml @@ -857,12 +857,92 @@ Item { anchors.verticalCenter: parent.verticalCenter checked: SettingsData.dankBarAutoHide onToggled: toggled => { - return SettingsData.set("dankBarAutoHide", + return SettingsData.set("dankBarAutoHide", toggled) } } } + Column { + width: parent.width + spacing: Theme.spacingS + visible: SettingsData.dankBarAutoHide + leftPadding: Theme.spacingM + + Rectangle { + width: parent.width - parent.leftPadding + height: 1 + color: Theme.outline + opacity: 0.2 + } + + Row { + width: parent.width - parent.leftPadding + spacing: Theme.spacingS + + StyledText { + text: I18n.tr("Hide Delay (ms)") + font.pixelSize: Theme.fontSizeSmall + color: Theme.surfaceText + font.weight: Font.Medium + anchors.verticalCenter: parent.verticalCenter + } + + Item { + width: parent.width - hideDelayText.implicitWidth - resetHideDelayBtn.width - Theme.spacingS - Theme.spacingM + height: 1 + + StyledText { + id: hideDelayText + visible: false + text: I18n.tr("Hide Delay (ms)") + font.pixelSize: Theme.fontSizeSmall + } + } + + DankActionButton { + id: resetHideDelayBtn + buttonSize: 20 + iconName: "refresh" + iconSize: 12 + backgroundColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) + iconColor: Theme.surfaceText + anchors.verticalCenter: parent.verticalCenter + onClicked: { + SettingsData.set("dankBarAutoHideDelay", 250) + } + } + + Item { + width: Theme.spacingS + height: 1 + } + } + + DankSlider { + id: hideDelaySlider + width: parent.width - parent.leftPadding + height: 24 + value: SettingsData.dankBarAutoHideDelay + minimum: 0 + maximum: 2000 + unit: "ms" + showValue: true + wheelEnabled: false + thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) + onSliderValueChanged: newValue => { + SettingsData.set("dankBarAutoHideDelay", newValue) + } + + Binding { + target: hideDelaySlider + property: "value" + value: SettingsData.dankBarAutoHideDelay + restoreMode: Binding.RestoreBinding + } + } + } + Rectangle { width: parent.width height: 1