diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-05-19 07:31:46 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-05-19 07:31:46 (GMT) |
commit | 3eb9a9404544a7b954d18f19d373883d0623da93 (patch) | |
tree | e255756b526f20a31ee2202bbbe159d3cd139e36 /demos/declarative | |
parent | 150ac88a4a68f2b0b23df14f027509e3c1d4c26a (diff) | |
download | Qt-3eb9a9404544a7b954d18f19d373883d0623da93.zip Qt-3eb9a9404544a7b954d18f19d373883d0623da93.tar.gz Qt-3eb9a9404544a7b954d18f19d373883d0623da93.tar.bz2 |
More precise positioning to leave 1-pixel inner margin
Diffstat (limited to 'demos/declarative')
-rw-r--r-- | demos/declarative/flickr/content/Progress.qml | 2 | ||||
-rw-r--r-- | demos/declarative/flickr/content/Slider.qml | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/demos/declarative/flickr/content/Progress.qml b/demos/declarative/flickr/content/Progress.qml index 92a232e..aa2a2e6 100644 --- a/demos/declarative/flickr/content/Progress.qml +++ b/demos/declarative/flickr/content/Progress.qml @@ -5,7 +5,7 @@ Item { Rect { id: Container; anchors.fill: parent; gradientColor: "#66000000"; - pen.color: "white"; pen.width: 1; color: "#66343434"; radius: height/2 - 2 + pen.color: "white"; pen.width: 0; color: "#66343434"; radius: height/2 - 2 } Rect { diff --git a/demos/declarative/flickr/content/Slider.qml b/demos/declarative/flickr/content/Slider.qml index 92f4993..aae4631 100644 --- a/demos/declarative/flickr/content/Slider.qml +++ b/demos/declarative/flickr/content/Slider.qml @@ -3,25 +3,25 @@ Item { // value is read/write. property real value - onValueChanged: { Handle.x = (value - minimum) * Slider.xMax / (maximum - minimum); } + onValueChanged: { Handle.x = 2 + (value - minimum) * Slider.xMax / (maximum - minimum); } property real maximum: 1 property real minimum: 1 - property int xMax: Slider.width - Handle.width - 2 + property int xMax: Slider.width - Handle.width - 4 Rect { id: Container; anchors.fill: parent; gradientColor: "#66000000"; - pen.color: "white"; pen.width: 1; color: "#66343434"; radius: 8 + pen.color: "white"; pen.width: 0; color: "#66343434"; radius: 8 } Rect { id: Handle - x: Slider.width / 2 - Handle.width / 2; y: 2; width: 30; height: 12 + x: Slider.width / 2 - Handle.width / 2; y: 2; width: 30; height: Slider.height-4 color: "lightgray"; gradientColor: "gray"; radius: 6 MouseRegion { anchors.fill: parent; drag.target: parent - drag.axis: "x"; drag.xmin: 2; drag.xmax: Slider.xMax - onPositionChanged: { value = (maximum - minimum) * Handle.x / Slider.xMax + minimum; } + drag.axis: "x"; drag.xmin: 2; drag.xmax: Slider.xMax+2 + onPositionChanged: { value = (maximum - minimum) * (Handle.x-2) / Slider.xMax + minimum; } } } } |