diff options
| author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2013-09-25 17:13:06 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 15:20:34 +0200 |
| commit | c21bc7749fb2331d92bf5c109c9225583d882582 (patch) | |
| tree | f7d9c60967f24e6e78d488b61a6760a9f82ae9bc /src/controls/Styles/Base/SpinBoxStyle.qml | |
| parent | fcf32036a301d43c8b3b825df80265226a4563b3 (diff) | |
Add text alignment property to SpinBox and SpinBoxStyle
- Added a public alignment property
- Made it possible to set the default alignment in SpinBoxStyle
- Made it possible to override the default spinbox size.
- Change default text alignment to AlignRight for base and mac style.
Change-Id: I3d02ecb880eb2d1e9ad77725207cd88bf4fc2a89
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/Styles/Base/SpinBoxStyle.qml')
| -rw-r--r-- | src/controls/Styles/Base/SpinBoxStyle.qml | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/controls/Styles/Base/SpinBoxStyle.qml b/src/controls/Styles/Base/SpinBoxStyle.qml index a983efbe3..1d18627c8 100644 --- a/src/controls/Styles/Base/SpinBoxStyle.qml +++ b/src/controls/Styles/Base/SpinBoxStyle.qml @@ -76,7 +76,22 @@ Style { } /*! The content margins of the text field. */ - padding { top: 0 ; left: 5 ; right: 12 ; bottom: 0 } + padding { top: 0 ; left: 5 ; right: 18 ; bottom: 0 } + + /*! \qmlproperty enumeration horizontalAlignment + + This property defines the default text aligment. + + The supported values are: + \list + \li Qt.AlignLeft + \li Qt.AlignHCenter + \li Qt.AlignRight + \endlist + + The default value is Qt.AlignRight + */ + property int horizontalAlignment: Qt.AlignRight /*! The text color. */ property color textColor: __syspal.text @@ -114,7 +129,7 @@ Style { /*! The background of the SpinBox. */ property Component background: Item { implicitHeight: 25 - implicitWidth: 80 + implicitWidth: styleData.contentWidth + 26 BorderImage { id: image anchors.fill: parent @@ -143,7 +158,7 @@ Style { /*! \internal */ property Component panel: Item { id: styleitem - implicitWidth: styleData.contentWidth + 26 + implicitWidth: backgroundLoader.implicitWidth implicitHeight: backgroundLoader.implicitHeight property color foregroundColor: spinboxStyle.textColor @@ -155,8 +170,8 @@ Style { property rect upRect: Qt.rect(width - incrementControlLoader.implicitWidth, 0, incrementControlLoader.implicitWidth, height / 2 + 1) property rect downRect: Qt.rect(width - decrementControlLoader.implicitWidth, height / 2, decrementControlLoader.implicitWidth, height / 2) - property int horizontalTextAlignment: Qt.AlignLeft - property int verticalTextAlignment: Qt.AlignVCenter + property int horizontalAlignment: spinboxStyle.horizontalAlignment + property int verticalAlignment: Qt.AlignVCenter Loader { id: backgroundLoader |
