mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
dankbar: configurable auto-hide delay
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -399,7 +399,7 @@ Item {
|
||||
|
||||
Timer {
|
||||
id: revealHold
|
||||
interval: 250
|
||||
interval: SettingsData.dankBarAutoHideDelay
|
||||
repeat: false
|
||||
onTriggered: topBarCore.revealSticky = false
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user