1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

dankbar: de-bounce bar settings

This commit is contained in:
bbedward
2025-11-23 22:23:18 -05:00
parent b3c07edef6
commit 2db79ef202

View File

@@ -53,6 +53,120 @@ Item {
} }
} }
Timer {
id: edgeSpacingDebounce
interval: 100
repeat: false
property real pendingValue: 4
onTriggered: {
SettingsData.updateBarConfig(selectedBarId, {
spacing: pendingValue
});
notifyHorizontalBarChange();
}
}
Timer {
id: exclusiveZoneDebounce
interval: 100
repeat: false
property real pendingValue: 0
onTriggered: {
SettingsData.updateBarConfig(selectedBarId, {
bottomGap: pendingValue
});
notifyHorizontalBarChange();
}
}
Timer {
id: sizeDebounce
interval: 100
repeat: false
property real pendingValue: 4
onTriggered: {
SettingsData.updateBarConfig(selectedBarId, {
innerPadding: pendingValue
});
notifyHorizontalBarChange();
}
}
Timer {
id: popupGapsManualDebounce
interval: 100
repeat: false
property real pendingValue: 4
onTriggered: {
SettingsData.updateBarConfig(selectedBarId, {
popupGapsManual: pendingValue
});
notifyHorizontalBarChange();
}
}
Timer {
id: gothCornerRadiusDebounce
interval: 100
repeat: false
property real pendingValue: 12
onTriggered: {
SettingsData.updateBarConfig(selectedBarId, {
gothCornerRadiusValue: pendingValue
});
}
}
Timer {
id: borderOpacityDebounce
interval: 100
repeat: false
property real pendingValue: 1.0
onTriggered: {
SettingsData.updateBarConfig(selectedBarId, {
borderOpacity: pendingValue
});
}
}
Timer {
id: borderThicknessDebounce
interval: 100
repeat: false
property real pendingValue: 1
onTriggered: {
SettingsData.updateBarConfig(selectedBarId, {
borderThickness: pendingValue
});
}
}
Timer {
id: barTransparencyDebounce
interval: 100
repeat: false
property real pendingValue: 1.0
onTriggered: {
SettingsData.updateBarConfig(selectedBarId, {
transparency: pendingValue
});
notifyHorizontalBarChange();
}
}
Timer {
id: widgetTransparencyDebounce
interval: 100
repeat: false
property real pendingValue: 1.0
onTriggered: {
SettingsData.updateBarConfig(selectedBarId, {
widgetTransparency: pendingValue
});
notifyHorizontalBarChange();
}
}
// ! Hacky workaround because we want to re-register any vertical bars after changing a hBar // ! Hacky workaround because we want to re-register any vertical bars after changing a hBar
// ! That allows them to re-make with the right exclusiveZone // ! That allows them to re-make with the right exclusiveZone
function notifyHorizontalBarChange() { function notifyHorizontalBarChange() {
@@ -1710,10 +1824,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.updateBarConfig(selectedBarId, { edgeSpacingDebounce.pendingValue = newValue;
spacing: newValue edgeSpacingDebounce.restart();
});
notifyHorizontalBarChange();
} }
Binding { Binding {
@@ -1786,10 +1898,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.updateBarConfig(selectedBarId, { exclusiveZoneDebounce.pendingValue = newValue;
bottomGap: newValue exclusiveZoneDebounce.restart();
});
notifyHorizontalBarChange();
} }
Binding { Binding {
@@ -1862,10 +1972,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.updateBarConfig(selectedBarId, { sizeDebounce.pendingValue = newValue;
innerPadding: newValue sizeDebounce.restart();
});
notifyHorizontalBarChange();
} }
Binding { Binding {
@@ -1968,10 +2076,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.updateBarConfig(selectedBarId, { popupGapsManualDebounce.pendingValue = newValue;
popupGapsManual: newValue popupGapsManualDebounce.restart();
});
notifyHorizontalBarChange();
} }
Binding { Binding {
@@ -2100,9 +2206,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.updateBarConfig(selectedBarId, { gothCornerRadiusDebounce.pendingValue = newValue;
gothCornerRadiusValue: newValue gothCornerRadiusDebounce.restart();
});
} }
Binding { Binding {
@@ -2267,9 +2372,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.updateBarConfig(selectedBarId, { borderOpacityDebounce.pendingValue = newValue / 100;
borderOpacity: newValue / 100 borderOpacityDebounce.restart();
});
} }
Binding { Binding {
@@ -2342,9 +2446,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.updateBarConfig(selectedBarId, { borderThicknessDebounce.pendingValue = newValue;
borderThickness: newValue borderThicknessDebounce.restart();
});
} }
Binding { Binding {
@@ -2426,10 +2529,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.updateBarConfig(selectedBarId, { barTransparencyDebounce.pendingValue = newValue / 100;
transparency: newValue / 100 barTransparencyDebounce.restart();
});
notifyHorizontalBarChange();
} }
Binding { Binding {
@@ -2503,10 +2604,8 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.updateBarConfig(selectedBarId, { widgetTransparencyDebounce.pendingValue = newValue / 100;
widgetTransparency: newValue / 100 widgetTransparencyDebounce.restart();
});
notifyHorizontalBarChange();
} }
Binding { Binding {