Title: [119710] trunk/Tools
- Revision
- 119710
- Author
- [email protected]
- Date
- 2012-06-07 05:11:29 -0700 (Thu, 07 Jun 2012)
Log Message
[Qt] Improve the visual of the viewport info box
https://bugs.webkit.org/show_bug.cgi?id=88410
Reviewed by Tor Arne Vestbø.
Improve the visual and make it possible to see the content more easy.
* MiniBrowser/qt/qml/ViewportInfoItem.qml:
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (119709 => 119710)
--- trunk/Tools/ChangeLog 2012-06-07 12:08:45 UTC (rev 119709)
+++ trunk/Tools/ChangeLog 2012-06-07 12:11:29 UTC (rev 119710)
@@ -1,3 +1,14 @@
+2012-06-06 Kenneth Rohde Christiansen <[email protected]>
+
+ [Qt] Improve the visual of the viewport info box
+ https://bugs.webkit.org/show_bug.cgi?id=88410
+
+ Reviewed by Tor Arne Vestbø.
+
+ Improve the visual and make it possible to see the content more easy.
+
+ * MiniBrowser/qt/qml/ViewportInfoItem.qml:
+
2012-06-06 Mariusz Grzegorczyk <[email protected]>
[EFL][WK2] Compile webkit1 and webkit2 by default.
Modified: trunk/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml (119709 => 119710)
--- trunk/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml 2012-06-07 12:08:45 UTC (rev 119709)
+++ trunk/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml 2012-06-07 12:11:29 UTC (rev 119710)
@@ -1,92 +1,136 @@
import QtQuick 2.0
import QtWebKit 3.0
-Rectangle {
+Item {
property var test
property var preferredMinimumContentsWidth
- color: "black"
- opacity: 0.8
+ function formatScale(value) {
+ return "<b>" + parseFloat(value.toFixed(4)) + "</b>x";
+ }
- Item {
- anchors.fill: parent
- anchors.margins: 20
+ function formatSize(value) {
+ return "<b>" + value.width.toFixed() + "x" + value.height.toFixed() + "</b>px"
+ }
- property string fontFamily: "Nokia Pure, Helvetica"
- property color fontColor: "white"
+ function formatBool(value) {
+ return "<b>" + (value ? "yes" : "no") + "</b>"
+ }
+ Rectangle {
+ id: title;
+
+ anchors {
+ top: parent.top
+ left: parent.left
+ margins: 10
+ }
+
+ height: 50
+ width: 250
+
+ color: "blue"
+
Text {
id: viewportInfoLabel
+
+ anchors {
+ verticalCenter: parent.verticalCenter
+ left: parent.left
+ leftMargin: 10
+ }
+
text: "Viewport Info"
color: "white"
- font.family: "Nokia Pure, Helvetica"
+ font.family: "Nokia Pure"
font.pointSize: 24
}
- Text {
- id: currentScaleLabel
- anchors.top: viewportInfoLabel.bottom
- anchors.topMargin: 30
- text: "Current scale: " + parseFloat(test.contentsScale.toFixed(4))
- font.family: parent.fontFamily
- color: parent.fontColor
+ }
+
+ Rectangle {
+ color: "gray"
+ opacity: 0.9
+
+ anchors {
+ top: title.bottom
+ left: title.left
+ topMargin: 10
}
- Text {
- id: initialScaleLabel
- anchors.top: currentScaleLabel.bottom
- text: "Initial scale: " + parseFloat(test.initialScale.toFixed(4))
- font.family: parent.fontFamily
- color: parent.fontColor
+
+ width: 340
+ height: 270
+
+ Item {
+ id: textBox
+
+ anchors {
+ fill: parent
+ margins: 10
+ }
+
+ property string fontFamily: "Nokia Pure"
+ property color fontColor: "black"
+
+ Column {
+ anchors.fill: parent
+ spacing: 20
+ Column {
+ Text {
+ text: "Current scale: " + formatScale(test.contentsScale)
+ font.family: textBox.fontFamily
+ color: textBox.fontColor
+ }
+ }
+
+ Column {
+ Text {
+ text: "Initial scale: " + formatScale(test.initialScale)
+ font.family: textBox.fontFamily
+ color: textBox.fontColor
+ }
+ Text {
+ text: "Minimum scale: " + formatScale(test.minimumScale)
+ font.family: textBox.fontFamily
+ color: textBox.fontColor
+ }
+ Text {
+ text: "Maximum scale: " + formatScale(test.maximumScale)
+ font.family: textBox.fontFamily
+ color: textBox.fontColor
+ }
+ }
+
+ Column {
+ Text {
+ text: "Device pixel ratio: " + formatScale(test.devicePixelRatio)
+ font.family: textBox.fontFamily
+ color: textBox.fontColor
+ }
+ Text {
+ text: "Contents size: " + formatSize(test.contentsSize)
+ font.family: textBox.fontFamily
+ color: textBox.fontColor
+ }
+ Text {
+ text: "Viewport layout size: " + formatSize(test.layoutSize)
+ font.family: textBox.fontFamily
+ color: textBox.fontColor
+ }
+ }
+
+ Column {
+ Text {
+ text: "Adapt for small screens: " + formatBool(preferredMinimumContentsWidth)
+ font.family: textBox.fontFamily
+ color: textBox.fontColor
+ }
+ Text {
+ text: "Allows scaling: " + formatBool(test.isScalable)
+ font.family: textBox.fontFamily
+ color: textBox.fontColor
+ }
+ }
+ }
}
- Text {
- id: minimumScaleLabel
- anchors.top: initialScaleLabel.bottom
- 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(test.maximumScale.toFixed(4))
- font.family: parent.fontFamily
- color: parent.fontColor
- }
- Text {
- id: devicePixelRatioLabel
- anchors.top: maximumScaleLabel.bottom
- anchors.topMargin: 30
- 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: " + 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: " + test.layoutSize.width + "x" + test.layoutSize.height
- font.family: parent.fontFamily
- color: parent.fontColor
- }
- Text {
- id: preferredMinimumContentsWidthLabel
- anchors.top: layoutSizeLabel.bottom
- text: "Preferred minimum contents width: " + preferredMinimumContentsWidth
- font.family: parent.fontFamily
- color: parent.fontColor
- }
- Text {
- id: scalableLabel
- anchors.top: preferredMinimumContentsWidthLabel.bottom
- anchors.topMargin: 30
- text: "View " + (test.isScalable ? "is " : "is not " ) + "scalable."
- font.family: parent.fontFamily
- color: parent.fontColor
- }
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes