1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -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

@@ -343,16 +343,6 @@ Item {
}
}
LazyLoader {
id: powerConfirmModalLoader
active: false
ConfirmModal {
id: powerConfirmModal
}
}
LazyLoader {
id: processListPopoutLoader
@@ -489,22 +479,6 @@ Item {
id: powerMenuModal
onPowerActionRequested: (action, title, message) => {
if (SettingsData.powerActionConfirm) {
powerConfirmModalLoader.active = true;
if (powerConfirmModalLoader.item) {
powerConfirmModalLoader.item.confirmButtonColor = action === "poweroff" ? Theme.error : action === "reboot" ? Theme.warning : Theme.primary;
powerConfirmModalLoader.item.show(title, message, () => actionApply(action), function () {});
}
} else {
actionApply(action);
}
}
onLockRequested: {
lock.activate();
}
function actionApply(action) {
switch (action) {
case "logout":
SessionService.logout();
@@ -524,6 +498,10 @@ Item {
}
}
onLockRequested: {
lock.activate();
}
Component.onCompleted: {
PopoutService.powerMenuModal = powerMenuModal;
}