summaryrefslogtreecommitdiffstats
path: root/examples/webengine/quicknanobrowser/BrowserWindow.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webengine/quicknanobrowser/BrowserWindow.qml')
-rw-r--r--examples/webengine/quicknanobrowser/BrowserWindow.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml
index c133e121..3465e0da 100644
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml
@@ -141,6 +141,27 @@ ApplicationWindow {
RowLayout {
anchors.fill: parent;
ToolButton {
+ enabled: currentWebView && (currentWebView.canGoBack || currentWebView.canGoForward)
+ menu:Menu {
+ id: historyMenu
+
+ Instantiator {
+ model: currentWebView && currentWebView.navigationHistory.items
+ MenuItem {
+ text: model.title
+ onTriggered: currentWebView.goBackOrForward(model.offset)
+ checkable: !enabled
+ checked: !enabled
+ enabled: model.offset
+ }
+
+ onObjectAdded: historyMenu.insertItem(index, object)
+ onObjectRemoved: historyMenu.removeItem(object)
+ }
+ }
+ }
+
+ ToolButton {
id: backButton
iconSource: "icons/go-previous.png"
onClicked: currentWebView.goBack()