From bd5799ee730f1b3789c75e29e8406bf8017bb559 Mon Sep 17 00:00:00 2001 From: Andras Becsi Date: Fri, 7 Aug 2015 17:08:40 +0200 Subject: Fix active focus propagation to hide the IM if not needed --- src/qml/BrowserWindow.qml | 18 +++++++++--------- src/qml/NavigationBar.qml | 6 +++++- src/qml/PageView.qml | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/qml/BrowserWindow.qml b/src/qml/BrowserWindow.qml index 3b5cb25..75dcb69 100644 --- a/src/qml/BrowserWindow.qml +++ b/src/qml/BrowserWindow.qml @@ -268,10 +268,6 @@ Item { states: [ State { name: "enabled" - PropertyChanges { - target: homeScreen - state: "disabled" - } PropertyChanges { target: urlDropDown height: browserWindow.height - toolBarSize - 3 @@ -286,6 +282,11 @@ Item { } ] + Rectangle { + anchors.fill: parent + color: "#e4e4e4" + } + ListView { id: historyList property int remainingHeight: Math.min((historyList.count + 1) * toolBarSize, inputPanel.y - toolBarSize - 3) @@ -311,8 +312,8 @@ Item { onClicked: { if (!url) return - navigation.addressBar.text = url - navigation.addressBar.accepted() + navigation.webView.url = url + navigation.webView.forceActiveFocus() } } @@ -360,7 +361,6 @@ Item { z: 5 width: historyList.width height: toolBarSize - border.color: iconStrokeColor MouseArea { anchors.fill: parent onClicked: { @@ -371,8 +371,8 @@ Item { } else { constructedUrl = engine.fromUserInput(googleSearchQuery + string) } - navigation.addressBar.text = constructedUrl - navigation.addressBar.accepted() + navigation.webView.url = constructedUrl + navigation.webView.forceActiveFocus() } } Row { diff --git a/src/qml/NavigationBar.qml b/src/qml/NavigationBar.qml index 6c3fadf..a463801 100644 --- a/src/qml/NavigationBar.qml +++ b/src/qml/NavigationBar.qml @@ -171,6 +171,7 @@ ToolBar { if (activeFocus) { urlBar.selectAll() root.state = "enabled" + homeScreen.state = "disabled" urlDropDown.state = "enabled" } else { urlDropDown.state = "disabled" @@ -213,6 +214,7 @@ ToolBar { onClicked: { if (state == "load") { webView.loading ? webView.stop() : webView.reload() + webView.forceActiveFocus() return } urlBar.selectAll() @@ -295,8 +297,10 @@ ToolBar { if (homeScreen.state == "disabled" || homeScreen.state == "edit") { homeScreen.messageBox.state = "disabled" homeScreen.state = "enabled" - } else if (homeScreen.state != "disabled") + homeScreen.forceActiveFocus() + } else if (homeScreen.state != "disabled") { homeScreen.state = "disabled" + } } } Rectangle { diff --git a/src/qml/PageView.qml b/src/qml/PageView.qml index fa20a82..243d892 100644 --- a/src/qml/PageView.qml +++ b/src/qml/PageView.qml @@ -572,7 +572,7 @@ Rectangle { text: item.title font.pixelSize: 16 font.family: defaultFontFamily - color: "#0B508C" + color: settingsView.privateBrowsingEnabled ? "white" : "#0B508C" visible: wrapper.isCurrentItem && wrapper.visibility == 1.0 } } -- cgit v1.2.3