summaryrefslogtreecommitdiff
path: root/Tools/MiniBrowser
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
commit8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch)
treecdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Tools/MiniBrowser
parent1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff)
downloadqtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Tools/MiniBrowser')
-rw-r--r--Tools/MiniBrowser/qt/BrowserWindow.cpp4
-rw-r--r--Tools/MiniBrowser/qt/qml/BrowserWindow.qml6
-rw-r--r--Tools/MiniBrowser/qt/qml/Dialog.qml96
-rw-r--r--Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml18
4 files changed, 77 insertions, 47 deletions
diff --git a/Tools/MiniBrowser/qt/BrowserWindow.cpp b/Tools/MiniBrowser/qt/BrowserWindow.cpp
index 27946d5d5..70750c6a7 100644
--- a/Tools/MiniBrowser/qt/BrowserWindow.cpp
+++ b/Tools/MiniBrowser/qt/BrowserWindow.cpp
@@ -51,7 +51,7 @@ BrowserWindow::BrowserWindow(WindowOptions* options)
Utils* utils = new Utils(this);
engine()->rootContext()->setContextProperty("utils", utils);
engine()->rootContext()->setContextProperty("options", options);
- setSource(QUrl("qrc:/qml/BrowserWindow.qml"));
+ setSource(QUrl("qrc:///qml/BrowserWindow.qml"));
connect(rootObject(), SIGNAL(pageTitleChanged(QString)), this, SLOT(onTitleChanged(QString)));
connect(rootObject(), SIGNAL(newWindow(QString)), this, SLOT(newWindow(QString)));
if (options->startFullScreen())
@@ -118,7 +118,7 @@ void BrowserWindow::updateVisualMockTouchPoints(const QList<QTouchEvent::TouchPo
QQuickItem* mockTouchPointItem = rootObject()->findChild<QQuickItem*>(mockTouchPointIdentifier, Qt::FindDirectChildrenOnly);
if (!mockTouchPointItem) {
- QQmlComponent touchMockPointComponent(engine(), QUrl("qrc:/qml/MockTouchPoint.qml"));
+ QQmlComponent touchMockPointComponent(engine(), QUrl("qrc:///qml/MockTouchPoint.qml"));
mockTouchPointItem = qobject_cast<QQuickItem*>(touchMockPointComponent.create());
mockTouchPointItem->setObjectName(mockTouchPointIdentifier);
mockTouchPointItem->setProperty("pointId", QVariant(touchPoint.id()));
diff --git a/Tools/MiniBrowser/qt/qml/BrowserWindow.qml b/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
index b2917cb80..96d53d309 100644
--- a/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
+++ b/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
@@ -31,6 +31,7 @@ import QtWebKit 3.0
import QtWebKit.experimental 1.0
Rectangle {
+ id: root
// Do not define anchors or an initial size here! This would mess up with QSGView::SizeRootObjectToView.
property alias webview: webView
@@ -56,6 +57,7 @@ Rectangle {
id: navigationBar
color: "#efefef"
height: 38
+ z: webView.z + 1
anchors {
top: parent.top
left: parent.left
@@ -292,6 +294,8 @@ Rectangle {
WebView {
id: webView
+ clip: false
+
anchors {
top: navigationBar.bottom
left: parent.left
@@ -352,6 +356,6 @@ Rectangle {
bottom: parent.bottom
}
visible: false
- viewportInfo : webView.experimental.viewportInfo
+ test : webView.experimental.test
}
}
diff --git a/Tools/MiniBrowser/qt/qml/Dialog.qml b/Tools/MiniBrowser/qt/qml/Dialog.qml
index 5ca6ee008..23b14cd37 100644
--- a/Tools/MiniBrowser/qt/qml/Dialog.qml
+++ b/Tools/MiniBrowser/qt/qml/Dialog.qml
@@ -27,58 +27,84 @@
import QtQuick 2.0
-Rectangle {
+Item {
id: dialog
+ anchors.fill: parent
+ z: 1000
+
+ // We want to be a child of the root item so that we can cover
+ // the whole scene with our "dim" overlay.
+ parent: root
+
property alias title: titleText.text
property alias message: messageText.text
default property alias __children: dynamicColumn.children
- color: "#efefef"
+ MouseArea {
+ id: mouseBlocker
+ anchors.fill: parent
+ onPressed: mouse.accepted = true
- width: 300
- height: 150
+ // FIXME: This does not block touch events :(
+ }
- border {
- width: 1
- color: "#bfbfbf"
+ Rectangle {
+ id: dimBackground
+ anchors.fill: parent
+ color: "black"
+ opacity: 0.4
}
- smooth: true
- radius: 5
+ Rectangle {
+ id: dialogWindow
- anchors.centerIn: parent
+ color: "#efefef"
- Item {
- id: staticContent
- anchors.centerIn: parent
- anchors.fill: parent
- anchors.margins: 10
-
- Text {
- id: titleText
- width: parent.width
- anchors.horizontalCenter: parent.horizontalCenter
- font.pixelSize: 16
- font.weight: Font.Bold
- elide: Text.ElideRight
+ width: 300
+ height: 150
+
+ border {
+ width: 1
+ color: "#bfbfbf"
}
- Text {
- id: messageText
- width: parent.width
- wrapMode: Text.WordWrap
+ smooth: true
+ radius: 5
+
+ anchors.centerIn: parent
+
+ Item {
+ id: staticContent
anchors.centerIn: parent
- }
+ anchors.fill: parent
+ anchors.margins: 10
+
+ Text {
+ id: titleText
+ width: parent.width
+ anchors.horizontalCenter: parent.horizontalCenter
+ font.pixelSize: 16
+ font.weight: Font.Bold
+ elide: Text.ElideRight
+ }
+
+ Text {
+ id: messageText
+ width: parent.width
+ wrapMode: Text.WordWrap
+ anchors.centerIn: parent
+ }
- Column {
- id: dynamicColumn
- spacing: 5
- anchors {
- margins: 10
- bottom: staticContent.bottom
- horizontalCenter: staticContent.horizontalCenter
+ Column {
+ id: dynamicColumn
+ spacing: 5
+ anchors {
+ margins: 10
+ bottom: staticContent.bottom
+ horizontalCenter: staticContent.horizontalCenter
+ }
}
}
}
diff --git a/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml b/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml
index 77f734cad..88ac01275 100644
--- a/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml
+++ b/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml
@@ -2,7 +2,7 @@ import QtQuick 2.0
import QtWebKit 3.0
Rectangle {
- property var viewportInfo
+ property var test
color: "black"
opacity: 0.8
@@ -25,28 +25,28 @@ Rectangle {
id: currentScaleLabel
anchors.top: viewportInfoLabel.bottom
anchors.topMargin: 30
- text: "Current scale: " + parseFloat(viewportInfo.currentScale.toFixed(4))
+ text: "Current scale: " + parseFloat(test.contentsScale.toFixed(4))
font.family: parent.fontFamily
color: parent.fontColor
}
Text {
id: initialScaleLabel
anchors.top: currentScaleLabel.bottom
- text: "Initial scale: " + parseFloat(viewportInfo.initialScale.toFixed(4))
+ text: "Initial scale: " + parseFloat(test.initialScale.toFixed(4))
font.family: parent.fontFamily
color: parent.fontColor
}
Text {
id: minimumScaleLabel
anchors.top: initialScaleLabel.bottom
- text: "Minimum scale: " + parseFloat(viewportInfo.minimumScale.toFixed(4))
+ text: "Minimum scale: " + parseFloat(test.minimumScale.toFixed(4))
font.family: parent.fontFamily
color: parent.fontColor
}
Text {
id: maximumScaleLabel
anchors.top: minimumScaleLabel.bottom
- text: "Maximum scale: " + parseFloat(viewportInfo.maximumScale.toFixed(4))
+ text: "Maximum scale: " + parseFloat(test.maximumScale.toFixed(4))
font.family: parent.fontFamily
color: parent.fontColor
}
@@ -54,21 +54,21 @@ Rectangle {
id: devicePixelRatioLabel
anchors.top: maximumScaleLabel.bottom
anchors.topMargin: 30
- text: "Device pixel ratio: " + parseFloat(viewportInfo.devicePixelRatio.toFixed(4))
+ text: "Device pixel ratio: " + parseFloat(test.devicePixelRatio.toFixed(4))
font.family: parent.fontFamily
color: parent.fontColor
}
Text {
id: contentsSizeLabel
anchors.top: devicePixelRatioLabel.bottom
- text: "Contents size: " + viewportInfo.contentsSize.width + "x" + viewportInfo.contentsSize.height
+ text: "Contents size: " + test.contentsSize.width + "x" + test.contentsSize.height
font.family: parent.fontFamily
color: parent.fontColor
}
Text {
id: layoutSizeLabel
anchors.top: contentsSizeLabel.bottom
- text: "Viewport layout size: " + viewportInfo.layoutSize.width + "x" + viewportInfo.layoutSize.height
+ text: "Viewport layout size: " + test.layoutSize.width + "x" + test.layoutSize.height
font.family: parent.fontFamily
color: parent.fontColor
}
@@ -76,7 +76,7 @@ Rectangle {
id: scalableLabel
anchors.top: layoutSizeLabel.bottom
anchors.topMargin: 30
- text: "View " + (viewportInfo.isScalable ? "is " : "is not " ) + "scalable."
+ text: "View " + (test.isScalable ? "is " : "is not " ) + "scalable."
font.family: parent.fontFamily
color: parent.fontColor
}