diff --git a/interface/resources/qml/controls-uit/Button.qml b/interface/resources/qml/controls-uit/Button.qml index c6bac84510..165de98878 100644 --- a/interface/resources/qml/controls-uit/Button.qml +++ b/interface/resources/qml/controls-uit/Button.qml @@ -8,7 +8,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -import QtQuick 2.5 +import QtQuick 2.7 import QtQuick.Controls 2.2 as Original import TabletScriptingInterface 1.0 @@ -22,7 +22,7 @@ Original.Button { property string buttonGlyph: ""; //TODO: add real Action item. Backport from Qt 5.10 - property QtObject action: null + property Shortcut action: null width: 120 height: hifi.dimensions.controlLineHeight @@ -37,6 +37,9 @@ Original.Button { onClicked: { tabletInterface.playSound(TabletEnums.ButtonClick); + if (action !== null) { + action.activated() + } } background: Rectangle { diff --git a/interface/resources/qml/dialogs/QueryDialog.qml b/interface/resources/qml/dialogs/QueryDialog.qml index 9a38c3f0d6..159e5a1801 100644 --- a/interface/resources/qml/dialogs/QueryDialog.qml +++ b/interface/resources/qml/dialogs/QueryDialog.qml @@ -9,7 +9,7 @@ // import QtQuick 2.5 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.2 import QtQuick.Dialogs 1.2 as OriginalDialogs import "../controls-uit" @@ -145,24 +145,30 @@ ModalWindow { margins: 0 bottomMargin: hifi.dimensions.contentSpacing.y } - Button { action: cancelAction } - Button { action: acceptAction } + Button { + action: cancelAction; + text: qsTr("Cancel"); + } + + Button { + action: acceptAction + text: qsTr("OK"); + } } - Action { + Shortcut { id: cancelAction - text: qsTr("Cancel") - shortcut: Qt.Key_Escape - onTriggered: { + sequence: Qt.Key_Escape + onActivated: { root.canceled(); root.destroy(); } } - Action { + + Shortcut { id: acceptAction - text: qsTr("OK") - shortcut: Qt.Key_Return - onTriggered: { + sequence: Qt.Key_Return + onActivated: { root.result = items ? comboBox.currentText : textResult.text root.selected(root.result); root.destroy();