summaryrefslogtreecommitdiff
path: root/src/controls/SpinBox.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-05-02 18:18:08 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-08 21:42:37 +0200
commit2416927b67dcb4021edd38231295c13fe1b5a580 (patch)
treef7d31bc4c1640d867ef59c4109766c3cc0a336a6 /src/controls/SpinBox.qml
parent2ae89b14d8dcc7176af3d475b38d3c023a1897a2 (diff)
downloadqtquickcontrols-2416927b67dcb4021edd38231295c13fe1b5a580.tar.gz
Refactor and clean up public style API
Change-Id: I10271c860abd9b45a262e3548628e6a3026e1a4f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/SpinBox.qml')
-rw-r--r--src/controls/SpinBox.qml42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml
index 6d366dc3..ab0eeb0b 100644
--- a/src/controls/SpinBox.qml
+++ b/src/controls/SpinBox.qml
@@ -146,26 +146,22 @@ Control {
}
/*! \internal */
- readonly property bool __upEnabled: value != maximumValue;
- /*! \internal */
- readonly property bool __downEnabled: value != minimumValue;
- /*! \internal */
- readonly property alias __upPressed: mouseUp.pressed
- /*! \internal */
- readonly property alias __downPressed: mouseDown.pressed
- /*! \internal */
- property alias __upHovered: mouseUp.containsMouse
- /*! \internal */
- property alias __downHovered: mouseDown.containsMouse
- /*! \internal */
- property alias __containsMouse: mouseArea.containsMouse
- /*! \internal */
property alias __text: input.text
- /*! \internal */
- readonly property int __contentHeight: Math.max(input.implicitHeight, 20)
- /*! \internal */
- readonly property int __contentWidth: Math.max(maxSizeHint.implicitWidth,
- minSizeHint.implicitWidth)
+
+ __controlState: QtObject {
+ readonly property bool upEnabled: value != maximumValue;
+ readonly property alias upHovered: mouseUp.containsMouse
+ readonly property alias upPressed: mouseUp.pressed
+
+ readonly property bool downEnabled: value != minimumValue;
+ readonly property alias downPressed: mouseDown.pressed
+ readonly property alias downHovered: mouseDown.containsMouse
+
+ readonly property alias containsMouse: mouseArea.containsMouse
+
+ readonly property int contentHeight: Math.max(input.implicitHeight, 20)
+ readonly property int contentWidth: Math.max(maxSizeHint.implicitWidth, minSizeHint.implicitWidth)
+ }
Text {
id: maxSizeHint
@@ -205,10 +201,10 @@ Control {
id: input
clip: true
anchors.fill: parent
- anchors.leftMargin: __panel ? __panel.leftMargin : 0
- anchors.topMargin: __panel ? __panel.topMargin : 0
- anchors.rightMargin: __panel ? __panel.rightMargin: 0
- anchors.bottomMargin: __panel ? __panel.bottomMargin: 0
+ anchors.leftMargin: __panel ? __panel.margins.left : 0
+ anchors.topMargin: __panel ? __panel.margins.top : 0
+ anchors.rightMargin: __panel ? __panel.margins.right: 0
+ anchors.bottomMargin: __panel ? __panel.margins.bottom: 0
focus: true
activeFocusOnPress: spinbox.activeFocusOnPress