File 0001-Some-UI-fixes-for-logout-dialog.patch of Package plasma5-workspace

From 553535ea35c9e3a2b82fc46e76e0b72fbd2143a6 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Sun, 9 Apr 2017 13:34:21 +0200
Subject: [PATCH] Some UI fixes for logout dialog

Less intrusive parts of 5f2f343ef ('UI fixes for logout dialog'):
* add an OK button, that was complained a lot
* Stop timer with arrow keys
* Hide timer label if timer not running
---
 lookandfeel/contents/logout/Logout.qml       | 22 +++++++++++++++++++---
 lookandfeel/contents/logout/LogoutButton.qml |  1 +
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/lookandfeel/contents/logout/Logout.qml b/lookandfeel/contents/logout/Logout.qml
index 839c390f..e1573f5e 100644
--- a/lookandfeel/contents/logout/Logout.qml
+++ b/lookandfeel/contents/logout/Logout.qml
@@ -74,6 +74,7 @@ PlasmaCore.ColorScope {
     }
 
     Timer {
+        id: countDownTimer
         running: true
         repeat: true
         interval: 1000
@@ -155,6 +156,14 @@ PlasmaCore.ColorScope {
 
         PlasmaComponents.Label {
             Layout.alignment: Qt.AlignHCenter
+            //opacity, as visible would re-layout
+            opacity: countDownTimer.running ? 1 : 0
+            Behavior on opacity {
+                OpacityAnimator {
+                    duration: units.longDuration
+                    easing.type: Easing.InOutQuad
+                }
+            }
             text: {
                 switch (sdtype) {
                     case ShutdownType.ShutdownTypeReboot:
@@ -167,10 +176,17 @@ PlasmaCore.ColorScope {
             }
         }
 
-        PlasmaComponents.Button {
+        RowLayout {
             Layout.alignment: Qt.AlignHCenter
-            text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Cancel")
-            onClicked: root.cancelRequested()
+            PlasmaComponents.Button {
+                enabled: root.currentAction != null
+                text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "OK")
+                onClicked: root.currentAction()
+            }
+            PlasmaComponents.Button {
+                text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Cancel")
+                onClicked: root.cancelRequested()
+            }
         }
     }
 }
diff --git a/lookandfeel/contents/logout/LogoutButton.qml b/lookandfeel/contents/logout/LogoutButton.qml
index 4c92657e..4de0b0d3 100644
--- a/lookandfeel/contents/logout/LogoutButton.qml
+++ b/lookandfeel/contents/logout/LogoutButton.qml
@@ -35,4 +35,5 @@ ActionButton {
             easing.type: Easing.InOutQuad
         }
     }
+    Keys.onPressed: countDownTimer.running = false
 }
-- 
2.12.0

openSUSE Build Service is sponsored by