Make buttons and tabs larger in QML examples and dialogs
authorShawn Rutledge <shawn.rutledge@digia.com>
Tue, 23 Jul 2013 09:19:33 +0000 (11:19 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 29 Jul 2013 09:06:06 +0000 (11:06 +0200)
Task-number: QTBUG-32578
Change-Id: Ic89058abc55e5e079f44862986b2132114456147
Reviewed-by: Liang Qi <liang.qi@digia.com>

examples/quick/dialogs/systemdialogs/ColorDialogs.qml
examples/quick/dialogs/systemdialogs/FileDialogs.qml
examples/quick/shared/Button.qml
examples/quick/shared/TabSet.qml
src/imports/dialogs/qml/Button.qml

index cd74dd6..0cb42a0 100644 (file)
@@ -115,15 +115,16 @@ Rectangle {
             right: parent.right
             bottom: parent.bottom
         }
-        height: 50
+        height: buttonRow.height * 1.2
         color: Qt.darker(palette.window, 1.1)
         border.color: Qt.darker(palette.window, 1.3)
         Row {
+            id: buttonRow
             spacing: 6
             anchors.verticalCenter: parent.verticalCenter
             anchors.left: parent.left
             anchors.leftMargin: 12
-            height: parent.height - 6
+            height: implicitHeight
             width: parent.width
             Button {
                 text: "Open"
index c8c5d13..b8df5e0 100644 (file)
@@ -138,15 +138,16 @@ Rectangle {
             right: parent.right
             bottom: parent.bottom
         }
-        height: 50
+        height: buttonRow.height * 1.2
         color: Qt.darker(palette.window, 1.1)
         border.color: Qt.darker(palette.window, 1.3)
         Row {
+            id: buttonRow
             spacing: 6
             anchors.verticalCenter: parent.verticalCenter
             anchors.left: parent.left
             anchors.leftMargin: 12
-            height: parent.height - 6
+            height: implicitHeight
             width: parent.width
             Button {
                 text: "Open"
index 551f7d6..468f945 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.1
+import QtQuick.Window 2.1
 
 Item {
     id: container
@@ -48,8 +49,8 @@ Item {
     signal clicked
     property alias containsMouse: mouseArea.containsMouse
     property alias pressed: mouseArea.pressed
-    implicitHeight: buttonLabel.implicitHeight * 1.2
-    implicitWidth: buttonLabel.implicitWidth * 1.2
+    implicitHeight: Math.max(Screen.logicalPixelDensity * 7, buttonLabel.implicitHeight * 1.2)
+    implicitWidth: Math.max(Screen.logicalPixelDensity * 11, buttonLabel.implicitWidth * 1.3)
     height: implicitHeight
     width: implicitWidth
 
@@ -64,7 +65,7 @@ Item {
             GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) }
         }
         antialiasing: true
-        radius: height / 4
+        radius: height / 6
         border.color: Qt.darker(palette.button, 1.5)
         border.width: 1
     }
index 10263a7..86050b6 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQuick.Window 2.1
 
 Item {
     id: tabWidget
@@ -65,7 +66,8 @@ Item {
         Repeater {
             model: stack.children.length
             delegate: Rectangle {
-                width: tabWidget.width / stack.children.length; height: 36
+                width: tabWidget.width / stack.children.length
+                height: Math.max(Screen.logicalPixelDensity * 11, label.implicitHeight * 1.2)
 
                 Rectangle {
                     width: parent.width; height: 1
@@ -79,6 +81,7 @@ Item {
                     visible: tabWidget.current == index
                 }
                 Text {
+                    id: label
                     horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter
                     anchors.fill: parent
                     text: stack.children[index].title
index 4a0ec12..26cc23a 100644 (file)
@@ -49,8 +49,8 @@ Item {
     signal clicked
     property alias containsMouse: mouseArea.containsMouse
     property alias pressed: mouseArea.pressed
-    implicitHeight: buttonLabel.implicitHeight * 1.2
-    implicitWidth: Math.max(Screen.logicalPixelDensity * 10, buttonLabel.implicitWidth * 1.2)
+    implicitHeight: Math.max(Screen.logicalPixelDensity * 7, buttonLabel.implicitHeight * 1.2)
+    implicitWidth: Math.max(Screen.logicalPixelDensity * 11, buttonLabel.implicitWidth * 1.3)
     height: implicitHeight
     width: implicitWidth
 
@@ -65,7 +65,7 @@ Item {
             GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) }
         }
         antialiasing: true
-        radius: height / 4
+        radius: height / 6
         border.color: Qt.darker(palette.button, 1.5)
         border.width: 1
     }