Merge lp:~haggai-eran/unity-2d/rtl-rating-stars-945719 into lp:unity-2d

Proposed by Haggai Eran
Status: Merged
Approved by: Gerry Boland
Approved revision: 947
Merged at revision: 953
Proposed branch: lp:~haggai-eran/unity-2d/rtl-rating-stars-945719
Merge into: lp:unity-2d
Diff against target: 22 lines (+5/-0)
1 file modified
shell/dash/RatingStars.qml (+5/-0)
To merge this branch: bzr merge lp:~haggai-eran/unity-2d/rtl-rating-stars-945719
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+95740@code.launchpad.net

Commit message

[dash] Fix rating stars alignment and behavior when in RTL locale (LP: #945719)

Description of the change

Hi,

This patch fixes the rendering and mouse behavior of the rating stars widget, when using right-to-left locales.
See bug #945719.

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Hi Haggai,
thanks for this! I've verified it mirrors the LTR visuals properly. Approved!
-Gerry

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/dash/RatingStars.qml'
2--- shell/dash/RatingStars.qml 2012-02-06 12:07:47 +0000
3+++ shell/dash/RatingStars.qml 2012-03-03 18:07:24 +0000
4@@ -61,6 +61,9 @@
5 Row {
6 id: stars
7
8+ // Required for right-to-left mirroring
9+ anchors.left: parent.left
10+
11 Repeater {
12 model: size
13 Star {
14@@ -95,6 +98,8 @@
15
16 /* What unit is the mouse over? This is the integer part of the rating (plus one)*/
17 var rating = (posX - posXOverUnit) / unitWidth + 1
18+ if (Utils.isRightToLeft())
19+ rating = size + 1 - rating
20
21 return Utils.clamp( rating, 0, size )
22 }

Subscribers

People subscribed via source and target branches