summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@theqtcompany.com>2015-08-07 17:08:03 +0200
committerAndras Becsi <andras.becsi@theqtcompany.com>2015-08-12 17:22:04 +0200
commitef66fb936b280a44000db0c3cdad87e6dc351caf (patch)
tree3599cd8b175683c4fabeeb2806ae06ed5fdb2683 /src
parent4fa0910228b096e446013b99799c9284dda9399d (diff)
Update for embedded
These changes make it possible to run the browser with Qt 5.5 and add missing imput method support.
Diffstat (limited to 'src')
-rw-r--r--src/qml/BrowserWindow.qml37
-rw-r--r--src/qml/NavigationBar.qml1
-rw-r--r--src/qml/PageView.qml6
-rw-r--r--src/qml/SettingsView.qml4
-rw-r--r--src/src.pro1
5 files changed, 40 insertions, 9 deletions
diff --git a/src/qml/BrowserWindow.qml b/src/qml/BrowserWindow.qml
index 9e55e4b..3b5cb25 100644
--- a/src/qml/BrowserWindow.qml
+++ b/src/qml/BrowserWindow.qml
@@ -45,6 +45,7 @@ import QtQuick.Layouts 1.0
import QtQuick.Window 2.1
import QtQuick.Controls.Private 1.0
import QtQuick.Dialogs 1.2
+import QtQuick.Enterprise.VirtualKeyboard 1.2
import "assets"
@@ -273,7 +274,7 @@ Item {
}
PropertyChanges {
target: urlDropDown
- height: Math.min(3 * toolBarSize, historyList.childrenRect.height)
+ height: browserWindow.height - toolBarSize - 3
}
},
State {
@@ -287,16 +288,19 @@ Item {
ListView {
id: historyList
+ property int remainingHeight: Math.min((historyList.count + 1) * toolBarSize, inputPanel.y - toolBarSize - 3)
model: navigation.webView.navigationHistory.items
clip: true
+ boundsBehavior: Flickable.StopAtBounds
+ footerPositioning: ListView.InlineFooter
visible: urlDropDown.state == "enabled"
- footerPositioning: ListView.OverlayFooter
+
anchors {
top: parent.top
left: parent.left
right: parent.right
}
- height: Math.min(childrenRect.height, parent.height)
+ height: remainingHeight
delegate: Rectangle {
id: wrapper
width: historyList.width
@@ -398,7 +402,6 @@ Item {
}
}
-
transitions: Transition {
PropertyAnimation { property: "height"; duration: animationDuration; easing.type : Easing.InSine }
}
@@ -423,4 +426,30 @@ Item {
right: parent.right
}
}
+ InputPanel {
+ id: inputPanel
+ y: browserWindow.height
+ anchors {
+ left: browserWindow.left
+ right: browserWindow.right
+ }
+ states: State {
+ name: "visible"
+ when: Qt.inputMethod.visible
+ PropertyChanges {
+ target: inputPanel
+ y: browserWindow.height - inputPanel.height
+ }
+ }
+ transitions: Transition {
+ from: ""
+ to: "visible"
+ reversible: true
+ NumberAnimation {
+ properties: "y"
+ duration: animationDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
}
diff --git a/src/qml/NavigationBar.qml b/src/qml/NavigationBar.qml
index 9071ead..6c3fadf 100644
--- a/src/qml/NavigationBar.qml
+++ b/src/qml/NavigationBar.qml
@@ -164,6 +164,7 @@ ToolBar {
Layout.fillWidth: true
text: webView ? webView.url : ""
activeFocusOnPress: true
+ inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase
placeholderText: qsTr("Search or type a URL")
onActiveFocusChanged: {
diff --git a/src/qml/PageView.qml b/src/qml/PageView.qml
index fb6ac12..fa20a82 100644
--- a/src/qml/PageView.qml
+++ b/src/qml/PageView.qml
@@ -36,7 +36,7 @@
****************************************************************************/
import QtQuick 2.5
-import QtWebEngine 1.2
+import QtWebEngine 1.1
import QtWebEngine.experimental 1.0
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
@@ -147,7 +147,9 @@ Rectangle {
settings.autoLoadImages: settingsView.autoLoadImages
settings.javascriptEnabled: !settingsView.javaScriptDisabled
- settings.pluginsEnabled: settingsView.pluginsEnabled
+
+ // This should be enabled as we can switch to Qt 5.6 (i.e. import QtWebEngine 1.2)
+ // settings.pluginsEnabled: settingsView.pluginsEnabled
onLoadingChanged: {
if (loading)
diff --git a/src/qml/SettingsView.qml b/src/qml/SettingsView.qml
index 6ed6e3f..2f04224 100644
--- a/src/qml/SettingsView.qml
+++ b/src/qml/SettingsView.qml
@@ -48,14 +48,14 @@ Rectangle {
property bool httpDiskCacheEnabled: appSettings[1].active
property bool autoLoadImages: appSettings[2].active
property bool javaScriptDisabled: appSettings[3].active
- property bool pluginsEnabled: appSettings[4].active
+ // property bool pluginsEnabled: appSettings[4].active
property var appSettings: [
{ "name": "Private Browsing", "active": false, "notify": function(v) { privateBrowsingEnabled = v; } },
{ "name": "Enable HTTP Disk Cache", "active": true, "notify": function(v) { httpDiskCacheEnabled = v; } },
{ "name": "Auto Load Images", "active": true, "notify": function(v) { autoLoadImages = v; } },
{ "name": "Disable JavaScript", "active": false, "notify": function(v) { javaScriptDisabled = v; } },
- { "name": "Enable Plugins", "active": false, "notify": function(v) { pluginsEnabled = v; } }
+// { "name": "Enable Plugins", "active": false, "notify": function(v) { pluginsEnabled = v; } }
]
function save() {
diff --git a/src/src.pro b/src/src.pro
index 913ae42..22a341c 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -32,6 +32,5 @@ QT += qml quick webengine
QT_PRIVATE += quick-private gui-private core-private
RESOURCES += resources.qrc
-CONFIG += qtquickcompiler
!cross_compile: DEFINES += HOST_BUILD