Merge lp:~lukas-kde/ubuntu-ui-toolkit/sliderStyleRTL into lp:ubuntu-ui-toolkit/staging

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Zsombor Egri
Approved revision: 2146
Merged at revision: 2143
Proposed branch: lp:~lukas-kde/ubuntu-ui-toolkit/sliderStyleRTL
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 74 lines (+27/-2)
3 files modified
src/imports/Components/Themes/Ambiance/1.2/SliderStyle.qml (+1/-1)
src/imports/Components/Themes/Ambiance/1.3/SliderStyle.qml (+1/-1)
tests/unit/visual/tst_slider.13.qml (+25/-0)
To merge this branch: bzr merge lp:~lukas-kde/ubuntu-ui-toolkit/sliderStyleRTL
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+309461@code.launchpad.net

Commit message

Fix slider progress rect with RTL languages

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
2144. By Lukáš Tinkl

add a test for LTR/RTL Slider

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
2145. By Lukáš Tinkl

move the property inside the slider

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
2146. By Lukáš Tinkl

move the test to visual

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

All cool, thanks!

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/imports/Components/Themes/Ambiance/1.2/SliderStyle.qml'
--- src/imports/Components/Themes/Ambiance/1.2/SliderStyle.qml 2015-04-24 14:43:08 +0000
+++ src/imports/Components/Themes/Ambiance/1.2/SliderStyle.qml 2016-10-31 14:33:54 +0000
@@ -48,7 +48,7 @@
48 overlayColor: sliderStyle.foregroundColor48 overlayColor: sliderStyle.foregroundColor
49 overlayRect: Qt.application.layoutDirection == Qt.LeftToRight ?49 overlayRect: Qt.application.layoutDirection == Qt.LeftToRight ?
50 Qt.rect(0.0, 0.0, thumb.x / thumb.barMinusThumbWidth, 1.0) :50 Qt.rect(0.0, 0.0, thumb.x / thumb.barMinusThumbWidth, 1.0) :
51 Qt.rect(1.0 - (thumb.x / thumb.barMinusThumbWidth), 0.0, 1.0, 1.0)51 Qt.rect(thumb.x / thumb.barMinusThumbWidth, 0.0, 1 - (thumb.x / thumb.barMinusThumbWidth), 1.0)
52 }52 }
5353
54 UbuntuShape {54 UbuntuShape {
5555
=== modified file 'src/imports/Components/Themes/Ambiance/1.3/SliderStyle.qml'
--- src/imports/Components/Themes/Ambiance/1.3/SliderStyle.qml 2016-02-10 17:46:21 +0000
+++ src/imports/Components/Themes/Ambiance/1.3/SliderStyle.qml 2016-10-31 14:33:54 +0000
@@ -49,7 +49,7 @@
49 overlayColor: sliderStyle.foregroundColor49 overlayColor: sliderStyle.foregroundColor
50 overlayRect: Qt.application.layoutDirection == Qt.LeftToRight ?50 overlayRect: Qt.application.layoutDirection == Qt.LeftToRight ?
51 Qt.rect(0.0, 0.0, thumb.x / thumb.barMinusThumbWidth, 1.0) :51 Qt.rect(0.0, 0.0, thumb.x / thumb.barMinusThumbWidth, 1.0) :
52 Qt.rect(1.0 - (thumb.x / thumb.barMinusThumbWidth), 0.0, 1.0, 1.0)52 Qt.rect(thumb.x / thumb.barMinusThumbWidth, 0.0, 1 - (thumb.x / thumb.barMinusThumbWidth), 1.0)
53 }53 }
5454
55 UbuntuShape {55 UbuntuShape {
5656
=== modified file 'tests/unit/visual/tst_slider.13.qml'
--- tests/unit/visual/tst_slider.13.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_slider.13.qml 2016-10-31 14:33:54 +0000
@@ -89,6 +89,14 @@
89 }89 }
90 }90 }
91 }91 }
92 Slider {
93 property bool enableRTL: false
94 LayoutMirroring.enabled: enableRTL
95 LayoutMirroring.childrenInherit: enableRTL
96
97 id: slider
98 readonly property rect bar: slider.__styleInstance && slider.__styleInstance.bar ? slider.__styleInstance.bar.overlayRect : null
99 }
92 }100 }
93101
94 UbuntuTestCase {102 UbuntuTestCase {
@@ -107,6 +115,7 @@
107 function cleanup() {115 function cleanup() {
108 flickSpy.target = null;116 flickSpy.target = null;
109 flickSpy.clear();117 flickSpy.clear();
118 slider.enableRTL = false;
110 }119 }
111120
112 function test_slider_blocks_flickable_data() {121 function test_slider_blocks_flickable_data() {
@@ -160,5 +169,21 @@
160 valueSpy.wait();169 valueSpy.wait();
161 compare(slider.value, to, "Slider has the wrong value!");170 compare(slider.value, to, "Slider has the wrong value!");
162 }171 }
172
173 function test_bar_rtl() {
174 verify(slider.bar);
175 slider.minimumValue = 0.0;
176 slider.maximumValue = 1.0;
177 slider.value = 0.3;
178
179 // check for LTR
180 print("Slider width:", slider.bar.width)
181 verify(slider.value >= slider.bar.width)
182
183 // check for RTL
184 slider.enableRTL = true;
185 print("Slider RTL width:", slider.bar.width)
186 verify(slider.value >= slider.bar.width)
187 }
163 }188 }
164}189}

Subscribers

People subscribed via source and target branches