mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
lockscreen: Trigger QuickActionButton action after time finished instead of onRelease
Currently, we wait user release the button to trigger action. It makes more sense to trigger directly when the timer is triggered. I keep buttonHeld variable for animation.
This commit is contained in:
parent
0512e1f3a2
commit
19e07982dc
1 changed files with 2 additions and 4 deletions
|
|
@ -94,10 +94,7 @@ AbstractButton {
|
|||
}
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
if (!buttonHeld) {
|
||||
return
|
||||
}
|
||||
function triggerButtonAction() {
|
||||
switch (buttonAction) {
|
||||
case ShellSettings.Settings.Flashlight:
|
||||
FlashlightUtil.toggleTorch();
|
||||
|
|
@ -116,6 +113,7 @@ AbstractButton {
|
|||
onTriggered: {
|
||||
haptics.buttonVibrate();
|
||||
buttonHeld = true;
|
||||
triggerButtonAction();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue