From: Shawn Rutledge Date: Tue, 23 Jul 2013 09:19:33 +0000 (+0200) Subject: Make buttons and tabs larger in QML examples and dialogs X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=09ed33677124a81117a10f1f5a47d7fae1ef22a8;p=konrad%2Fqtdeclarative.git Make buttons and tabs larger in QML examples and dialogs Task-number: QTBUG-32578 Change-Id: Ic89058abc55e5e079f44862986b2132114456147 Reviewed-by: Liang Qi --- diff --git a/examples/quick/dialogs/systemdialogs/ColorDialogs.qml b/examples/quick/dialogs/systemdialogs/ColorDialogs.qml index cd74dd6..0cb42a0 100644 --- a/examples/quick/dialogs/systemdialogs/ColorDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/ColorDialogs.qml @@ -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" diff --git a/examples/quick/dialogs/systemdialogs/FileDialogs.qml b/examples/quick/dialogs/systemdialogs/FileDialogs.qml index c8c5d13..b8df5e0 100644 --- a/examples/quick/dialogs/systemdialogs/FileDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/FileDialogs.qml @@ -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" diff --git a/examples/quick/shared/Button.qml b/examples/quick/shared/Button.qml index 551f7d6..468f945 100644 --- a/examples/quick/shared/Button.qml +++ b/examples/quick/shared/Button.qml @@ -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 } diff --git a/examples/quick/shared/TabSet.qml b/examples/quick/shared/TabSet.qml index 10263a7..86050b6 100644 --- a/examples/quick/shared/TabSet.qml +++ b/examples/quick/shared/TabSet.qml @@ -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 diff --git a/src/imports/dialogs/qml/Button.qml b/src/imports/dialogs/qml/Button.qml index 4a0ec12..26cc23a 100644 --- a/src/imports/dialogs/qml/Button.qml +++ b/src/imports/dialogs/qml/Button.qml @@ -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 }