From 4c370d0d32db74940935d09b28a1f5103d44bae3 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 12 Sep 2016 15:31:07 -0700 Subject: [PATCH] qml keyboard for query-dialog --- .../resources/qml/dialogs/QueryDialog.qml | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/dialogs/QueryDialog.qml b/interface/resources/qml/dialogs/QueryDialog.qml index 05cb347169..865c2f1bd7 100644 --- a/interface/resources/qml/dialogs/QueryDialog.qml +++ b/interface/resources/qml/dialogs/QueryDialog.qml @@ -15,6 +15,7 @@ import QtQuick.Dialogs 1.2 as OriginalDialogs import "../controls-uit" import "../styles-uit" import "../windows" +import "../controls" as Controls ModalWindow { id: root @@ -53,11 +54,17 @@ ModalWindow { } Item { + id: modalWindowItem clip: true width: pane.width height: pane.height anchors.margins: 0 + property bool keyboardRaised: false + property bool punctuationMode: false + + onKeyboardRaisedChanged: d.resize(); + QtObject { id: d readonly property int minWidth: 480 @@ -69,14 +76,14 @@ ModalWindow { var targetWidth = Math.max(titleWidth, pane.width) var targetHeight = (items ? comboBox.controlHeight : textResult.controlHeight) + 5 * hifi.dimensions.contentSpacing.y + buttons.height root.width = (targetWidth < d.minWidth) ? d.minWidth : ((targetWidth > d.maxWdith) ? d.maxWidth : targetWidth) - root.height = (targetHeight < d.minHeight) ? d.minHeight: ((targetHeight > d.maxHeight) ? d.maxHeight : targetHeight) + root.height = ((targetHeight < d.minHeight) ? d.minHeight: ((targetHeight > d.maxHeight) ? d.maxHeight : targetHeight)) + (modalWindowItem.keyboardRaised ? (200 + 2 * hifi.dimensions.contentSpacing.y) : 0) } } Item { anchors { top: parent.top - bottom: buttons.top; + bottom: keyboard1.top; left: parent.left; right: parent.right; margins: 0 @@ -110,6 +117,35 @@ ModalWindow { } } + // virtual keyboard, letters + Controls.Keyboard { + id: keyboard1 + y: parent.keyboardRaised ? parent.height : 0 + height: parent.keyboardRaised ? 200 : 0 + visible: parent.keyboardRaised && !parent.punctuationMode + enabled: parent.keyboardRaised && !parent.punctuationMode + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.bottom: buttons.top + anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y + } + + Controls.KeyboardPunctuation { + id: keyboard2 + y: parent.keyboardRaised ? parent.height : 0 + height: parent.keyboardRaised ? 200 : 0 + visible: parent.keyboardRaised && parent.punctuationMode + enabled: parent.keyboardRaised && parent.punctuationMode + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.bottom: buttons.top + anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y + } + Flow { id: buttons focus: true