Browse Source

Highight default action and listen to keyboard actions in image dialog

CURA-8684
casper 3 years ago
parent
commit
d3f01034a2
1 changed files with 14 additions and 4 deletions
  1. 14 4
      plugins/ImageReader/ConfigUI.qml

+ 14 - 4
plugins/ImageReader/ConfigUI.qml

@@ -220,20 +220,30 @@ UM.Dialog
         }
         }
     }
     }
 
 
+    Item
+    {
+        ButtonGroup
+        {
+            buttons: [ok_button, cancel_button]
+            checkedButton: ok_button
+        }
+    }
+
+    onAccepted: manager.onOkButtonClicked()
+    onRejected: manager.onCancelButtonClicked()
+
     rightButtons: [
     rightButtons: [
         Button
         Button
         {
         {
             id:ok_button
             id:ok_button
             text: catalog.i18nc("@action:button","OK");
             text: catalog.i18nc("@action:button","OK");
-            onClicked: { manager.onOkButtonClicked() }
-            enabled: true
+            onClicked: manager.onOkButtonClicked()
         },
         },
         Button
         Button
         {
         {
             id:cancel_button
             id:cancel_button
             text: catalog.i18nc("@action:button","Cancel");
             text: catalog.i18nc("@action:button","Cancel");
-            onClicked: { manager.onCancelButtonClicked() }
-            enabled: true
+            onClicked: manager.onCancelButtonClicked()
         }
         }
     ]
     ]
 }
 }