1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

power: switch to hold-style confirmation

fixes #775
This commit is contained in:
bbedward
2025-11-26 11:19:18 -05:00
parent 172c4bf0a9
commit 039c98b9e3
6 changed files with 348 additions and 113 deletions

View File

@@ -583,11 +583,54 @@ Item {
DankToggle {
width: parent.width
text: I18n.tr("Show Confirmation on Power Actions")
description: I18n.tr("Request confirmation on power off, restart, suspend, hibernate and logout actions")
text: I18n.tr("Hold to Confirm Power Actions")
description: I18n.tr("Require holding button/key to confirm power off, restart, suspend, hibernate and logout")
checked: SettingsData.powerActionConfirm
onToggled: checked => SettingsData.set("powerActionConfirm", checked)
}
Column {
width: parent.width
spacing: Theme.spacingS
visible: SettingsData.powerActionConfirm
Item {
width: parent.width - Theme.spacingM * 2
anchors.horizontalCenter: parent.horizontalCenter
height: holdDurationLabel.height
StyledText {
id: holdDurationLabel
text: I18n.tr("Hold Duration")
font.pixelSize: Appearance.fontSize.normal
font.weight: Font.Medium
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: SettingsData.powerActionHoldDuration + "s"
font.pixelSize: Appearance.fontSize.normal
font.weight: Font.Medium
color: Theme.primary
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
DankSlider {
width: parent.width - Theme.spacingM * 2
anchors.horizontalCenter: parent.horizontalCenter
minimum: 1
maximum: 10
unit: "s"
wheelEnabled: false
showValue: false
thumbOutlineColor: Theme.surfaceContainerHigh
value: SettingsData.powerActionHoldDuration
onSliderValueChanged: newValue => SettingsData.set("powerActionHoldDuration", newValue)
}
}
}
}