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
1=== modified file 'src/imports/Components/Themes/Ambiance/1.2/SliderStyle.qml'
2--- src/imports/Components/Themes/Ambiance/1.2/SliderStyle.qml 2015-04-24 14:43:08 +0000
3+++ src/imports/Components/Themes/Ambiance/1.2/SliderStyle.qml 2016-10-31 14:33:54 +0000
4@@ -48,7 +48,7 @@
5 overlayColor: sliderStyle.foregroundColor
6 overlayRect: Qt.application.layoutDirection == Qt.LeftToRight ?
7 Qt.rect(0.0, 0.0, thumb.x / thumb.barMinusThumbWidth, 1.0) :
8- Qt.rect(1.0 - (thumb.x / thumb.barMinusThumbWidth), 0.0, 1.0, 1.0)
9+ Qt.rect(thumb.x / thumb.barMinusThumbWidth, 0.0, 1 - (thumb.x / thumb.barMinusThumbWidth), 1.0)
10 }
11
12 UbuntuShape {
13
14=== modified file 'src/imports/Components/Themes/Ambiance/1.3/SliderStyle.qml'
15--- src/imports/Components/Themes/Ambiance/1.3/SliderStyle.qml 2016-02-10 17:46:21 +0000
16+++ src/imports/Components/Themes/Ambiance/1.3/SliderStyle.qml 2016-10-31 14:33:54 +0000
17@@ -49,7 +49,7 @@
18 overlayColor: sliderStyle.foregroundColor
19 overlayRect: Qt.application.layoutDirection == Qt.LeftToRight ?
20 Qt.rect(0.0, 0.0, thumb.x / thumb.barMinusThumbWidth, 1.0) :
21- Qt.rect(1.0 - (thumb.x / thumb.barMinusThumbWidth), 0.0, 1.0, 1.0)
22+ Qt.rect(thumb.x / thumb.barMinusThumbWidth, 0.0, 1 - (thumb.x / thumb.barMinusThumbWidth), 1.0)
23 }
24
25 UbuntuShape {
26
27=== modified file 'tests/unit/visual/tst_slider.13.qml'
28--- tests/unit/visual/tst_slider.13.qml 2016-06-15 13:46:51 +0000
29+++ tests/unit/visual/tst_slider.13.qml 2016-10-31 14:33:54 +0000
30@@ -89,6 +89,14 @@
31 }
32 }
33 }
34+ Slider {
35+ property bool enableRTL: false
36+ LayoutMirroring.enabled: enableRTL
37+ LayoutMirroring.childrenInherit: enableRTL
38+
39+ id: slider
40+ readonly property rect bar: slider.__styleInstance && slider.__styleInstance.bar ? slider.__styleInstance.bar.overlayRect : null
41+ }
42 }
43
44 UbuntuTestCase {
45@@ -107,6 +115,7 @@
46 function cleanup() {
47 flickSpy.target = null;
48 flickSpy.clear();
49+ slider.enableRTL = false;
50 }
51
52 function test_slider_blocks_flickable_data() {
53@@ -160,5 +169,21 @@
54 valueSpy.wait();
55 compare(slider.value, to, "Slider has the wrong value!");
56 }
57+
58+ function test_bar_rtl() {
59+ verify(slider.bar);
60+ slider.minimumValue = 0.0;
61+ slider.maximumValue = 1.0;
62+ slider.value = 0.3;
63+
64+ // check for LTR
65+ print("Slider width:", slider.bar.width)
66+ verify(slider.value >= slider.bar.width)
67+
68+ // check for RTL
69+ slider.enableRTL = true;
70+ print("Slider RTL width:", slider.bar.width)
71+ verify(slider.value >= slider.bar.width)
72+ }
73 }
74 }

Subscribers

People subscribed via source and target branches