summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsebastien baudouin <sebastien.baudouin@windriver.com>2015-03-30 17:13:22 +0200
committerJonathan Maw <jonathan.maw@codethink.co.uk>2015-05-20 13:16:48 +0000
commitab740d9c94ad7a70c1e90b10f791ceab4acc6993 (patch)
tree1f6d7c6fc18af6114a88e342f3e65082ab484edb
parented9fbe5d6bec47dbfebdd402af0c6e5ed2665365 (diff)
downloadbrowser-poc-ab740d9c94ad7a70c1e90b10f791ceab4acc6993.tar.gz
demoui: use QML WebView instead of browser service
This commit is there to move WebView management from browser service to demoui one. The reason for such modification is that currently the Wayland/IVI-shell integration on GDP is making such split not supported for following reasons: - WebView is creating a new surface when used from browser. This surface is not tagged "IVI-Surface-ID" and so not managed by him-controller. As a result the surface is not used by composer and so not visible on screen. - when application is overlapped by another one and then comes back (by user action for example) to foreground, we would have to bring back also the WebView surface which is not the case for the moment neither by teh system, neither by the application (demoui service) - when there are some transparency zones then it exists some unwanted artefact due to the mouse icon "remanance" and so is causing bad display behavior. For all those reasons the WebView is now managed in demoui QML file which is simpler and causing mush less Wayland/IVI-shell issue. The bookmark management remains on browser service side to demonstrate DBus interface usage.
-rw-r--r--demoui/qml/demoui/main.qml33
1 files changed, 20 insertions, 13 deletions
diff --git a/demoui/qml/demoui/main.qml b/demoui/qml/demoui/main.qml
index 1cc7765..74c5bea 100644
--- a/demoui/qml/demoui/main.qml
+++ b/demoui/qml/demoui/main.qml
@@ -1,3 +1,4 @@
+import QtWebKit 3.0
import QtQuick 2.0
import browserdbusinterface 1.0
@@ -14,9 +15,7 @@ Item {
}
Component.onCompleted: {
- browserinterface.connectdbussession("1")
- browserinterface.createPageWindow(1, 0, 80, 1024, 688);
- browserinterface.reload() // show initial url
+ browserinterface.connectdbussession("1");
}
Item {
@@ -46,14 +45,14 @@ Item {
Button {
id: backbutton
imagesource: "../../images/go-previous-view.png"
- onButtonClicked: browserinterface.goBack()
+ onButtonClicked: webView.goBack()
}
Button {
id: forwardbutton
anchors.left: backbutton.right
anchors.leftMargin: 1
imagesource: "../../images/go-next-view.png"
- onButtonClicked: browserinterface.goForward()
+ onButtonClicked: webView.goForward()
}
Rectangle {
id: urlbar
@@ -72,7 +71,7 @@ Item {
anchors.margins: 20
TextInput {
id: txturl
- text: browserinterface.url
+ text: webView.url
font.pixelSize: 20
clip: true
anchors.verticalCenter: parent.verticalCenter
@@ -85,18 +84,18 @@ Item {
bookmarklist.state = ""
privateMem.bookmarklistopen = false
root.bookmarksopen(privateMem.bookmarklistopen)
- browserinterface.loadurl(text)
+ webView.url = text
}
}
Rectangle {
id: progressbar
height: 5
- width: (parent.width - reloadbutton.width) * browserinterface.progress / 100
+ width: (parent.width - reloadbutton.width) * webView.loadProgress / 100
color: "lightblue"
anchors.bottom: parent.bottom
anchors.left: parent.left
- visible: browserinterface.pageloading
+ visible: webView.loading
}
Rectangle {
id: reloadbutton
@@ -105,12 +104,12 @@ Item {
color: "lightgray"
anchors.right: parent.right
Image {
- source: browserinterface.pageloading ? "../../images/process-stop.png" : "../../images/view-refresh.png"
+ source: webView.loading ? "../../images/process-stop.png" : "../../images/view-refresh.png"
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
- onClicked: browserinterface.pageloading ? browserinterface.stop() : browserinterface.reload()
+ onClicked: webView.loading ? webView.stop(): webView.reload()
}
}
}
@@ -122,7 +121,7 @@ Item {
anchors.rightMargin: 1
imagesource: "../../images/bookmarks.png"
onButtonClicked: {
- browserinterface.addBookmark(1, "", browserinterface.title, browserinterface.url, "", "")
+ browserinterface.addBookmark(1, "", webView.title, webView.url, "", "")
}
}
@@ -150,6 +149,7 @@ Item {
x: parent.width
width: 500
opacity: 0.7
+ z: 1
anchors.top: bookmarks.bottom
anchors.topMargin: 1
anchors.bottom: parent.bottom
@@ -233,7 +233,7 @@ Item {
anchors.right: parent.right
onClicked: {
list.currentIndex = index
- browserinterface.loadurl(model.modelData.url)
+ webView.url = model.modelData.url
bookmarklist.state = ""
privateMem.bookmarklistopen = false
root.bookmarksopen(privateMem.bookmarklistopen)
@@ -301,5 +301,12 @@ Item {
}
}
}
+ WebView {
+ id: webView
+ y: 80
+ height: 688
+ width: 1024
+ url: "http://www.google.fr"
+ }
}
}