diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-03-08 16:44:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-14 17:46:15 +0100 |
commit | 2050601125eeb72950a7d718b5136d16c898f8e6 (patch) | |
tree | 2d41323b8b61d5194c8b71b01ab0517459bbd131 /examples/quick/shared/Button.qml | |
parent | c64ab7db9856488a216e063052c8aeb6d36628a8 (diff) |
Cosmetic changes in common controls for examples
Use system palette colors. SimpleLauncherDelegate has its own "button"
rather than using the shared one, which really wasn't suitable for any other
purpose. So now example apps can use Button, and ToolButton isn't necessary.
Change-Id: I632397f36b96a26c32a86301ddacb85d5c3221f0
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'examples/quick/shared/Button.qml')
-rw-r--r-- | examples/quick/shared/Button.qml | 60 |
1 files changed, 28 insertions, 32 deletions
diff --git a/examples/quick/shared/Button.qml b/examples/quick/shared/Button.qml index 9bbc01ac01..9942a17b5c 100644 --- a/examples/quick/shared/Button.qml +++ b/examples/quick/shared/Button.qml @@ -43,14 +43,31 @@ import QtQuick 2.0 Item { id: container - property string text: "Button" - property string subText: "" + property alias text: buttonLabel.text + property alias label: buttonLabel signal clicked property alias containsMouse: mouseArea.containsMouse property alias pressed: mouseArea.pressed - implicitHeight: col.height - height: implicitHeight - width: buttonLabel.width + 20 + implicitHeight: buttonLabel.implicitHeight + implicitWidth: buttonLabel.implicitWidth + height: buttonLabel.implicitHeight + 12 + width: Math.max(80, implicitWidth + 8) + + SystemPalette { id: palette } + + Rectangle { + id: frame + anchors.fill: parent + color: palette.button + gradient: Gradient { + GradientStop { position: 0.0; color: mouseArea.pressed ? Qt.darker(palette.button, 1.3) : palette.button } + GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) } + } + antialiasing: true + radius: 5 + border.color: Qt.darker(palette.button, 1.5) + border.width: 1 + } MouseArea { id: mouseArea @@ -59,33 +76,12 @@ Item { hoverEnabled: true } - Column { - spacing: 2 - id: col - anchors.verticalCenter: parent.verticalCenter + Text { + id: buttonLabel width: parent.width - Text { - id: buttonLabel - anchors.left: parent.left - anchors.leftMargin: 10 - anchors.right: parent.right - anchors.rightMargin: 10 - text: container.text - color: "black" - font.pixelSize: 22 - wrapMode: Text.WrapAtWordBoundaryOrAnywhere - styleColor: "white" - style: Text.Raised - - } - Text { - id: buttonLabel2 - anchors.left: parent.left - anchors.leftMargin: 10 - text: container.subText - wrapMode: Text.WrapAtWordBoundaryOrAnywhere - color: "#666" - font.pixelSize: 12 - } + horizontalAlignment: Text.Center + text: container.text + color: palette.buttonText + anchors.verticalCenter: parent.verticalCenter } } |