From f7842507b94bd21ce2ed3d4f0d34e8cd83a1731a Mon Sep 17 00:00:00 2001 From: Arvid Nilsson Date: Wed, 2 Oct 2013 16:58:25 +0200 Subject: Add loadProgress API This exposes loadProgress in both widget and quick webengineviews. However, the progress will not change until we get an upstream change in Chromium where the content LoadProgressChanged API is exposed to all ports, not just Android. The upstream change is https://src.chromium.org/viewvc/chrome?revision=221010&view=revision Once we get that change, you'll see the widget example browser start to paint a blue progress rectangle in the background of the URL bar. Also, a progress bar was added to the quicknanobrowser, but it will be stuck at 0 for now. Change-Id: Icbaa01b86c013e0052b3abb7672c38e57128f44a Reviewed-by: Zeno Albisser --- examples/quick/quicknanobrowser/quickwindow.qml | 60 ++++++++++++++----------- 1 file changed, 34 insertions(+), 26 deletions(-) (limited to 'examples/quick') diff --git a/examples/quick/quicknanobrowser/quickwindow.qml b/examples/quick/quicknanobrowser/quickwindow.qml index 7ec4fc021..a3b8c405d 100644 --- a/examples/quick/quicknanobrowser/quickwindow.qml +++ b/examples/quick/quicknanobrowser/quickwindow.qml @@ -62,36 +62,43 @@ ApplicationWindow { toolBar: ToolBar { id: navigationBar - RowLayout { + ColumnLayout { anchors.fill: parent + RowLayout { + ToolButton { + id: backButton + iconSource: "icons/go-previous.png" + onClicked: webEngineView.goBack() + enabled: webEngineView.canGoBack + } + ToolButton { + id: forwardButton + iconSource: "icons/go-next.png" + onClicked: webEngineView.goForward() + enabled: webEngineView.canGoForward + } + ToolButton { + id: reloadButton + iconSource: webEngineView.loading ? "icons/process-stop.png" : "icons/view-refresh.png" + onClicked: webEngineView.reload() + } + Image { + id: faviconImage + width: 16; height: 16 + } + TextField { + id: addressBar + focus: true + Layout.fillWidth: true - ToolButton { - id: backButton - iconSource: "icons/go-previous.png" - onClicked: webEngineView.goBack() - enabled: webEngineView.canGoBack + onAccepted: webEngineView.url = utils.fromUserInput(text) + } } - ToolButton { - id: forwardButton - iconSource: "icons/go-next.png" - onClicked: webEngineView.goForward() - enabled: webEngineView.canGoForward - } - ToolButton { - id: reloadButton - iconSource: webEngineView.loading ? "icons/process-stop.png" : "icons/view-refresh.png" - onClicked: webEngineView.reload() - } - Image { - id: faviconImage - width: 16; height: 16 - } - TextField { - id: addressBar - focus: true + ProgressBar { Layout.fillWidth: true - - onAccepted: webEngineView.url = utils.fromUserInput(text) + id: progressBar + minimumValue: 0 + maximumValue: 100 } } } @@ -104,5 +111,6 @@ ApplicationWindow { onUrlChanged: addressBar.text = url onIconChanged: faviconImage.source = url + onLoadProgressChanged: progressBar.value = loadProgress } } -- cgit v1.2.3