summaryrefslogtreecommitdiffstats
path: root/tests/quicktestbrowser/quickwindow.qml
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2014-10-03 17:02:43 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2014-10-13 14:46:48 +0200
commitd69e0bb0d2fade75c31e57047c03746d694a6113 (patch)
tree2bf71354afd2a7268bcce91d7c448b6ceaf3fe39 /tests/quicktestbrowser/quickwindow.qml
parent9e6a94e5e1882e012f0a97943f0e77f976739fc3 (diff)
Implement programatic zooming for QtQuick
and add shortcuts in the examples (with a basic UI in the test browser) Change-Id: I237a04cf0b1fce2e0c6f8a19891ff3cb51727a40 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'tests/quicktestbrowser/quickwindow.qml')
-rw-r--r--tests/quicktestbrowser/quickwindow.qml24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/quicktestbrowser/quickwindow.qml b/tests/quicktestbrowser/quickwindow.qml
index f24717b01..ebde5b1ab 100644
--- a/tests/quicktestbrowser/quickwindow.qml
+++ b/tests/quicktestbrowser/quickwindow.qml
@@ -121,6 +121,18 @@ ApplicationWindow {
browserWindow.showNormal()
}
}
+ Action {
+ shortcut: "Ctrl+0"
+ onTriggered: zoomController.reset()
+ }
+ Action {
+ shortcut: "Ctrl+-"
+ onTriggered: zoomController.zoomOut()
+ }
+ Action {
+ shortcut: "Ctrl+="
+ onTriggered: zoomController.zoomIn()
+ }
Menu {
id: backHistoryMenu
@@ -391,4 +403,16 @@ ApplicationWindow {
}
}
}
+ ZoomController {
+ id: zoomController
+ y: parent.mapFromItem(currentWebView, 0 , 0).y - 4
+ anchors.right: parent.right
+ width: (parent.width > 800) ? parent.width * 0.25 : 220
+ anchors.rightMargin: (parent.width > 400) ? 100 : 0
+ }
+ Binding {
+ target: currentWebView
+ property: "zoomFactor"
+ value: zoomController.zoomFactor
+ }
}