From 11129edddefec6d2bf70368b5cf23c1d2a376891 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 12 Jun 2018 18:48:41 +0200 Subject: [PATCH 1/3] Remove extra textfield fro address ber input --- .../qml/hifi/tablet/TabletAddressDialog.qml | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index 08f86770e6..9a472de046 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -89,6 +89,7 @@ StackView { property bool keyboardEnabled: false property bool punctuationMode: false + property bool keyboardRaised: false width: parent.width height: parent.height @@ -210,6 +211,8 @@ StackView { QQC2.TextField { id: addressLine + + focus: true width: addressLineContainer.width - addressLineContainer.anchors.leftMargin - addressLineContainer.anchors.rightMargin; anchors { left: addressLineContainer.left; @@ -236,24 +239,20 @@ StackView { color: hifi.colors.text background: Item {} - QQC2.Label { - T.TextField { - id: control + } - padding: 6 // numbers taken from Qt\5.9.2\Src\qtquickcontrols2\src\imports\controls\TextField.qml - leftPadding: padding + 4 - } + QQC2.Label { + font: addressLine.font - font: parent.font + x: addressLine.x + y: addressLine.y + leftPadding: addressLine.leftPadding + topPadding: addressLine.topPadding - x: control.leftPadding - y: control.topPadding - - text: parent.placeholderText2 - verticalAlignment: "AlignVCenter" - color: 'gray' - visible: parent.text === '' - } + text: addressLine.placeholderText2 + verticalAlignment: "AlignVCenter" + color: 'gray' + visible: addressLine.text === '' } Rectangle { From 010309ba312a1c572a0908ba9793f91f9042d092 Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 13 Jun 2018 14:51:29 +0200 Subject: [PATCH 2/3] Add focus change logging. Switch off all focus hacks --- interface/resources/qml/desktop/Desktop.qml | 6 +++--- interface/src/Application.cpp | 2 +- libraries/ui/src/OffscreenUi.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/desktop/Desktop.qml b/interface/resources/qml/desktop/Desktop.qml index a1b89e1529..4c1d337124 100644 --- a/interface/resources/qml/desktop/Desktop.qml +++ b/interface/resources/qml/desktop/Desktop.qml @@ -225,12 +225,12 @@ FocusScope { } Component.onCompleted: { - //offscreenWindow.activeFocusItemChanged.connect(onWindowFocusChanged); - focusHack.start(); + offscreenWindow.activeFocusItemChanged.connect(onWindowFocusChanged); + //focusHack.start(); } function onWindowFocusChanged() { - //console.log("Focus item is " + offscreenWindow.activeFocusItem); + console.log("Focus item is " + offscreenWindow.activeFocusItem); // FIXME this needs more testing before it can go into production // and I already cant produce any way to have a modal dialog lose focus diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index acdcdef2cf..5902f2bc9b 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3985,7 +3985,7 @@ void Application::mousePressEvent(QMouseEvent* event) { // hence, we should defocus all of the offscreen UI windows, in order to allow // keyboard shortcuts not to be swallowed by them. In particular, WebEngineViews // will consume all keyboard events. - offscreenUi->unfocusWindows(); + //offscreenUi->unfocusWindows(); auto eventPosition = getApplicationCompositor().getMouseEventPosition(event); QPointF transformedPos = offscreenUi->mapToVirtualScreen(eventPosition); diff --git a/libraries/ui/src/OffscreenUi.cpp b/libraries/ui/src/OffscreenUi.cpp index 25f0652496..62671e7c37 100644 --- a/libraries/ui/src/OffscreenUi.cpp +++ b/libraries/ui/src/OffscreenUi.cpp @@ -679,7 +679,7 @@ void OffscreenUi::createDesktop(const QUrl& url) { menuInitializer(_vrMenu); } - new KeyboardFocusHack(); + //new KeyboardFocusHack(); connect(_desktop, SIGNAL(showDesktop()), this, SIGNAL(showDesktop())); }); } From 27906bcdc84e5d1884542f1b9c0b0bcfd72ffcac Mon Sep 17 00:00:00 2001 From: vladest Date: Fri, 29 Jun 2018 21:16:14 +0200 Subject: [PATCH 3/3] Turn on focus hacks again --- interface/resources/qml/desktop/Desktop.qml | 6 +++--- interface/src/Application.cpp | 2 +- libraries/ui/src/OffscreenUi.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/desktop/Desktop.qml b/interface/resources/qml/desktop/Desktop.qml index 4c1d337124..a1b89e1529 100644 --- a/interface/resources/qml/desktop/Desktop.qml +++ b/interface/resources/qml/desktop/Desktop.qml @@ -225,12 +225,12 @@ FocusScope { } Component.onCompleted: { - offscreenWindow.activeFocusItemChanged.connect(onWindowFocusChanged); - //focusHack.start(); + //offscreenWindow.activeFocusItemChanged.connect(onWindowFocusChanged); + focusHack.start(); } function onWindowFocusChanged() { - console.log("Focus item is " + offscreenWindow.activeFocusItem); + //console.log("Focus item is " + offscreenWindow.activeFocusItem); // FIXME this needs more testing before it can go into production // and I already cant produce any way to have a modal dialog lose focus diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 813a0ad818..a60d72073c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3992,7 +3992,7 @@ void Application::mousePressEvent(QMouseEvent* event) { // hence, we should defocus all of the offscreen UI windows, in order to allow // keyboard shortcuts not to be swallowed by them. In particular, WebEngineViews // will consume all keyboard events. - //offscreenUi->unfocusWindows(); + offscreenUi->unfocusWindows(); auto eventPosition = getApplicationCompositor().getMouseEventPosition(event); QPointF transformedPos = offscreenUi->mapToVirtualScreen(eventPosition); diff --git a/libraries/ui/src/OffscreenUi.cpp b/libraries/ui/src/OffscreenUi.cpp index 62671e7c37..25f0652496 100644 --- a/libraries/ui/src/OffscreenUi.cpp +++ b/libraries/ui/src/OffscreenUi.cpp @@ -679,7 +679,7 @@ void OffscreenUi::createDesktop(const QUrl& url) { menuInitializer(_vrMenu); } - //new KeyboardFocusHack(); + new KeyboardFocusHack(); connect(_desktop, SIGNAL(showDesktop()), this, SIGNAL(showDesktop())); }); }