Merge lp:~haggai-eran/unity-2d/rtl-rebased into lp:unity-2d
- rtl-rebased
- Merge into trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp:~haggai-eran/unity-2d/rtl-rebased |
Merge into: | lp:unity-2d |
Diff against target: |
307 lines (+78/-16) 11 files modified
launcher/Launcher.qml (+21/-1) launcher/LauncherList.qml (+5/-4) libunity-2d-private/src/edgehitdetector.cpp (+1/-1) libunity-2d-private/src/focuspath.cpp (+18/-4) libunity-2d-private/src/launchermenu.cpp (+3/-1) panel/applets/appname/appnameapplet.cpp (+3/-1) places/GridViewWithSpacing.qml (+2/-0) places/LensBar.qml (+1/-1) places/MultiRangeSelectionBar.qml (+4/-2) places/RatingStars.qml (+6/-1) places/dash.qml (+14/-0) |
To merge this branch: | bzr merge lp:~haggai-eran/unity-2d/rtl-rebased |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gerry Boland (community) | Needs Fixing | ||
Review via email: mp+82151@code.launchpad.net |
Commit message
Fix several issues with unity-2d under a right-to-left locale.
- [launcher] Move the edge hit detector one pixel to the right when in RTL locales (LP: #877292)
- [panel] Change panel window buttons alignment when in RTL locale (LP: #858053)
- [dash] Fix rating stars alignment when in RTL locale.
- [dash] Switch left and right keys when in RTL locale (LP: #886686)
Description of the change
Fix several issues with unity-2d under a right-to-left locale.
- [launcher] Move the edge hit detector one pixel to the right when in RTL locales (LP: #877292)
- [panel] Change panel window buttons alignment when in RTL locale (LP: #858053)
- [dash] Fix rating stars alignment when in RTL locale.
- [dash] Switch left and right keys when in RTL locale (LP: #886686)
Gerry Boland (gerboland) wrote : | # |
Another bug:
1. Press F10. File menu gets opened
2. Press right and left
Result: left & right motions are backward.
Gerry Boland (gerboland) wrote : | # |
Note I'd just like to draw to your attention the following issues not related to this commit:
Launcher
- Pips on Launcher (white triangles indicating app running) are not RTL
- Launcher grey line boundary on wrong side
- Launcher Context menu shape wrong, not a mirror image anyway. Are they too tall?
Dash
- In Filter, the "MultiRange" filter looks bad. The edge images need to be flipped
- In Filter, the "Checkboxes" of the Type area in the Files lens are too close together
Many, many thanks for your excellent work!
-G
- 781. By Lohith D Shivamurthy
-
[launcher] Mouse hover at left edge of panel should not reveal launcher
- 782. By Olivier Tilloy
-
[dash] Work around a bug in QML that causes a crash when the layout is mirrored (RTL locales).
Haggai Eran (haggai-eran) wrote : | # |
Hi,
I believe I solved the first issue you mention in commit 773. For the second one, I'm not sure, but I think it is the responsibility of unity-panel-
I have changes I wanted to submit to it for issue #858072, which I also think needs unity-panel-service cooperation, but I'm waiting for my nux patches to be accepted first.
As for the rest of them, I'll try to work on them soon. By the way, how do I test the different filters?
- 783. By Renato Araujo Oliveira Filho
-
[tests] Fix problems with Gtk version during the creation of QApplication for tests.
Haggai Eran (haggai-eran) wrote : | # |
Could you elaborate why you say that launcher pips are not mirrored? They seem mirrored to me, both in their direction, and in their position.
Haggai Eran (haggai-eran) wrote : | # |
Regarding the launcher context menu, I found two differences between the RTL and LTR versions. First, the RTL's arrow isn't centered vertically when the menu is folded, while the LTR version's arrow is centered. Second, in the RTL version, when the menus aren't folded, there is some extra padding to the left and right of the menu items.
I'm not sure what causes these differences, since the RTL CSS file and the images seem to be a simple mirror of the LTR versions.
Gerry Boland (gerboland) wrote : | # |
> Could you elaborate why you say that launcher pips are not mirrored? They seem
> mirrored to me, both in their direction, and in their position.
Because I'm an idiot and should think before I type! Sorry, RTL does confuse my brain a little.
Gerry Boland (gerboland) wrote : | # |
> By the way, how do I test the different filters?
Different lenses have different filters.
- Applications lens has "type" which are effectively radio-buttons (not distinguished from checkboxes in the code), and "ratings"
- Files lens has "last modified" (radio-buttons), "type" (radio) and "size" (multi-range)
- Music lens has "Genres" (checkboxes) and I possibly "Decade" (multi-range)
Haggai Eran (haggai-eran) wrote : | # |
Okay. I believe I've fixed the spacing issue in the radio buttons under Files lens (in commit 775), and the multi-range rendering in commit 776.
There's another problem in the Files lens size filter, though. Perhaps it only affects the Hebrew locale, but the font size is too large, and the different sizes are ellipsized. While testing I reduced the "small" font size so I could read them, but perhaps the best solution would be a larger multi-range widget, or a shorter translation.
Haggai
- 784. By Florian Boucault
-
Centralised configuration management into config.h. All common accesses to DConf go through there.
New APIs available:
QConf& unity2dConfiguration()
QConf& launcher2dConfiguration( )
QConf& panel2dConfiguration()
QConf& unityConfiguration()
QConf& launcherConfiguration( )
QConf& panelConfiguration() - 785. By Florian Boucault
-
[dash] Fixed warning upon connection to updateDashModeD
ependingOnScree nGeometry which is a SLOT not a SIGNAL. - 786. By Florian Boucault
-
[packaging] Bumped release version to 5.2 in debian/changelog
- 787. By Tiago Salem Herrmann
-
[dash] add selectionColor property to the search field in order to fix issue #880222
- 788. By Renato Araujo Oliveira Filho
-
[places] Rewrite RenderGrid to use only one Flickable element
* Created FocusPath element to help in the keyboard navigation;
* The code used to manually scroll the grid was removed, now everything is done by the QML Flickable element;
* This new implementation of RenderGrid allows every component be inside of this scroller, which makes the grid more flexible for moving elements around, helping in the implementation of Preview screen; - 789. By Renato Araujo Oliveira Filho
-
[tests] Fixed Cmake files to correct works with ctest.
Now you can run the tests from the build directory using:
- ctest (check ctest --help for more details)
- make test - 790. By Albert Astals Cid
-
[code] Add const & for foreach "iterators"
Avoids a copy of each object. It is true that most of those objects are
implicitly shared so the win isn't huge but we still save some atomic/mutex/something locking
Gerry Boland (gerboland) wrote : | # |
Thanks for the commit Haggai. My apologies that we are slow in reviewing it, we currently have a high-priority task that we're working on, and it is taking up our time.
We will get to it soon. Apologies
-Gerry
- 791. By Lohith D Shivamurthy
-
[launcher] Force the launcher to reposition to the beginning when Dash is summoned with Super key
- 792. By Gerry Boland
-
Rewrite KeyMonitor XEvent handler to use QSocketNotifier instead of separate thread. This singleton will now be deconstructed properly on application quit. Also free X11 objects when they're unnecessary.
Haggai Eran (haggai-eran) wrote : | # |
Sure, I understand.
Haggai
- 793. By Gerry Boland
-
[tests] Run Unit Tests with Xvfb, disabling those who will not work with this configuration. Fixes: 894381. Reviewed by Tiago Salem Herrmann.
- 794. By Albert Astals Cid
-
[launcher] Do not resend the visibleChanged(
false) if we were already not visible How does this happen:
* You start the launcher, you have a maximized window, thus it hides
* Then you alt+tab to another maximized window, this calls activeWindowChangedCB that calls updateVisibility that decides that has to hide the panel, thus it call hidesPanel again This has the effect of confusing the unity2dpanel since VisibilityContr
oller:: updatePanelVisi bility will call Unity2dPanel: :slideOut when it was already hidden, this confusion results in bug 892004. Fixes: 892004. Reviewed by Didier Roche. - 795. By Lohith D Shivamurthy
-
[launcher] Force the launcher to reposition to the beginning when Alt-F1 is hit. Fixes: 885304. Reviewed by Gerry Boland.
- 796. By Lohith D Shivamurthy
-
Mouse move over top left corner should not reveal the launcher.
Launcher edge detector is screenheight - panel height. . Fixes: 884267. Reviewed by Gerry Boland.
- 797. By Alberto Mardegan
-
(resubmitting without prerequisite branch)
[dash, panel] Add window controls to dash window
Show window controls for closing, minimizing and maximizing the Dash.
One potentially big issue:
Although the Dash window state (maximized/
unmaximized) is set in DConf, at the next startup the Dash ignores that settings: this is because the Dash itself determines what window mode is best right after it's started. We need to clarify with the UI designers whether this behaviour is the intended one.. Fixes: 860400. Reviewed by Didier Roche. - 798. By Alberto Mardegan
-
[spread] Allow keyboard navigation between workspaces
Turn the Workspace repeater into a GridView, which takes care of giving the
keyboard focus to the proper child element.Contributed by Alberto Mardegan (mardy). Fixes: 744978. Reviewed by Gerry Boland.
- 799. By Alberto Mardegan
-
[dash] Better handling of screen geometry
ScreenInfo:
:availableGeome try() method will return the same as QDesktopWidget: :availableGeome try() returns;
A new method ScreenInfo::panelsFreeGeom etry() will return the available geometry minus the launcher. The screenGeometry and availableGeometry properties were removed from the DashDeclarative class, because they were unused (and ScreenInfo provides the same information)
Contributed by Alberto Mardegan (mardy). Fixes: . Reviewed by Gerry Boland.
- 800. By Michał Sawicz
-
[lib] make LauncherDropItem a FocusScope. Fixes: . Reviewed by Gerry Boland.
- 801. By Florian Boucault
-
[spread] Synchronize the workspaces layout between the spread and the window manager.
Force a square layout regardless of the number of workspaces requested.WorkspacesInfo:
:updateWorkspac eGeometry underwent a major cleanup in order to
implement the above confidently._NET_NUMBER_
OF_DESKTOPS and _NET_DESKTOP_LAYOUT refer to the root window's X properties. The code had the following issues:
- if _NET_NUMBER_OF_DESKTOPS is not set and WorkspacesInfo: :updateWorkspac eGeometry
decides to default to 4, the property _NET_NUMBER_OF_DESKTOPS was not set to 4.
- "sanity checks" performed when _NET_DESKTOP_LAYOUT is set but incomplete were
not smart enough to force a square layout and not always applied.
- the function was simply too long and convoluted to be easily understood.. Fixes: https://bugs.launchpad .net/bugs/ 715587. Reviewed by Lohith D Shivamurthy. - 802. By Tiago Salem Herrmann
-
[lanucher] Fix trash and workspaces truncated highlights.
ListView is not properly calculating its height due to itemPadding variable, introduced to fix a problem with spacing.
The launcher is now considering 66 the real size of its icons instead of 54, so the selectionOutline is taken into account
when calculating its height.. Fixes: https://bugs.launchpad .net/bugs/ 876589. Reviewed by Gerry Boland. - 803. By Albert Astals Cid
-
[launcher] Do not hide the launcher immediately after removing an icon. Fixes: https:/
/bugs.launchpad .net/bugs/ 884410. Reviewed by Tiago Salem Herrmann. - 804. By Ugo Riboni
-
This branch removes the use-struts dconf option and enables struts automatically when the user selects hide-mode 0 (never hide).
Please note that struts don't get enabled or disabled when entering force visible mode, since it's a temporary mode that can't be enabled by the user explicitly. In that mode whatever struts settings was in place before will be maintained.. Fixes: . Reviewed by Gerry Boland.
- 805. By Florian Boucault
-
[dash] Fixed up and generalised definition and use of literal font sizes ('small', 'medium', etc.)
Created new javascript library fontUtils.js with new fontSizeToPixel
s(size) function abstracted out from TextCustom.qml
Changed 'large' to be 17px instead of 16px.
Defined 'xx-large' and used it in the search input.
Removed default size case.
Changed TileHorizontal to use 'small' size (13px) instead of nothing (14px).. Fixes: . Reviewed by Michał Sawicz. - 806. By Florian Boucault
-
[workspace switcher] Fixing up broken overlaid layout by reverting bzr revision 799.
- 807. By Didier Roche-Tolomelli
-
Build with the new and shiny unity-core 5. UNBLOCK. Fixes: . Appoved by .
- 808. By Lohith D Shivamurthy
-
[launcher] Showing the Desktop should also reveal the launcher. Fixes: https:/
/bugs.launchpad .net/bugs/ 898161. Appoved by Gerry Boland, Tiago Salem Herrmann. - 809. By Lohith D Shivamurthy
-
[panel] Desktop label changed to 'Ubuntu' Desktop. Fixes: https:/
/bugs.launchpad .net/bugs/ 869873. Appoved by Gerry Boland. - 810. By Tiago Salem Herrmann
-
In a particular scenario unity-2d-places may abort due to a SIGABRT raised by QConf().
If for some reason (probably during a distro upgrade) the schema file isn't properly installed and
unity-2d-places is wrapped, then it simply aborts with the following message:unity-2d-places: [FATAL] Settings schema 'com.canonical.
Unity2d' is not installed This patch adds a simple check if the schema file is present, and if not, assume the default
value. Other components like launcher and panel won't probably have this same issue since
they keep running in memory, and not launched on-the-fly.. Fixes: https://bugs.launchpad .net/bugs/ 857575. Appoved by . - 811. By Florian Boucault
-
[dash] SearchEntry: elide search hint when needed.. Fixes: . Appoved by .
- 812. By Florian Boucault
-
[launcher] Fixed giving the focus to the launcher by pressing Alt+F1.
Fixes https:/
/bugs.launchpad .net/unity- 2d/+bug/ 901505. Fixes: . Appoved by Gerry Boland. - 813. By Lohith D Shivamurthy
-
[launcher] tooltip positioned to center of the tile properly. Fixes: https:/
/bugs.launchpad .net/bugs/ 898349. Appoved by . - 814. By Florian Boucault
-
[launcher] Clip the GnomeBackground so that it cannot overflow the launcher.. Fixes: . Appoved by .
- 815. By Florian Boucault
-
[dash] Smoothen arrows when scaled up and down.. Fixes: . Appoved by .
- 816. By Florian Boucault
-
[dash] Implemented multi line text properly:
- multiline text not fully displayed is now elided
- not displayed lines are not clipped but simply never shownFixes bug https:/
/bugs.launchpad .net/unity- 2d/+bug/ 901491. Fixes: https:/ /bugs.launchpad .net/bugs/ 901491. Appoved by Gerry Boland. - 817. By Florian Boucault
-
[spread][dash] Remove unnecessary caching of ScreenInfo that is a singleton.. Fixes: . Appoved by .
- 818. By Lohith D Shivamurthy
-
[Dash] clicking maximize button should toggle the Dash between maximize and unmaximize state. Fixes: https:/
/bugs.launchpad .net/bugs/ 860400. Appoved by Tiago Salem Herrmann. - 819. By Gerry Boland
-
Bump libunity-core dependency to version 5 for panel (missed by commit 807). Fix 4.0 and 5.0 package conflict in PPA. Fixes: . Appoved by .
- 820. By Tiago Salem Herrmann
-
When switching between workspaces we need to invalidade the previous active window, as it belongs
to the previous active workspace.. Fixes: https://bugs.launchpad .net/bugs/ 897640. Appoved by Lohith D Shivamurthy. - 821. By Didier Roche-Tolomelli
-
Change build-dep as the nux package is now named nux 2.0. Fixes: . Appoved by .
- 822. By Florian Boucault
-
[dash] Do not unload the current page when exiting it. That does not change
the user experience at all and improves the speed at which the dash opens
up in a number of cases.Reference: https:/
/bugs.launchpad .net/unity- 2d/+bug/ 881756 The workarounds crashers in the code removed by this change were still valid.. Fixes: . Appoved by Gerry Boland.
- 823. By Florian Boucault
-
[dash & spread] Do not use a timestamp to make sure the window screenshots are
refreshed but instead make use of the 'cache' property of the Image QML element
recently introduced in Qt Quick 1.1Removed unused ScreenInfo:
:currentTime( ). Fixes: . Appoved by Gerry Boland. - 824. By Michał Sawicz
-
[lib] make Scrollbar abstracted. Fixes: . Appoved by .
- 825. By Gerry Boland
-
[launcher] Move to Unity-Core5 requires updating the path to shared the icon directory. Fixes Dash icon. Fixes: https:/
/bugs.launchpad .net/bugs/ 903182. Appoved by . - 826. By Florian Boucault
-
[launcher][dash] Resolved some discrepancies in layout with design:
- launcher width
- launcher tiles spacing
- search entry position and size
- filter pane position and width. Fixes: . Appoved by Andrea Cimitan. - 827. By Gerry Boland
-
[core] Update compatibility with UnityCore5 API.
Changes
- *SearchFinished signals passing Lens::Hints
- Lens active property changed to a ViewType enum of HIDDEN, HOME_VIEW, LENS_VIEW. Update Dash to use these.. Fixes: . Appoved by Lohith D Shivamurthy, Mikkel Kamstrup Erlandsen. - 828. By Daniel Nyström
-
Enable parallel build in debian/rules. Tested with -j13 on 12 virtual cores and it decreased build time significantly.. Fixes: . Appoved by Gerry Boland.
- 829. By Lohith D Shivamurthy
-
[dash] Centralized Configuration management into config.h. Cleanup dashsettings.cpp. Fixes: . Appoved by Gerry Boland.
- 830. By Florian Boucault
-
[spread] Windows and background are now limited in size to 512 which saves video
memory when using the OpenGL backend and can improve overall performance.. Fixes: https://bugs.launchpad .net/bugs/ 808716. Appoved by Gerry Boland. - 831. By Gerry Boland
-
[tests] Add Automated User Experience testing using "Testability"
Add support for Testability, a Qt application automated testing framework, with some boilerplate code to allow easy writing of tests using Ruby's Test::Util library. Also added is a Ruby library called XDo which allows control of the X server and fake mouse, keyboard and window management.
A couple of sample tests for the launcher have been written. This required the addition of some objectName definitions to the launcher.. Fixes: https:/
/bugs.launchpad .net/bugs/ 903495. Appoved by Tiago Salem Herrmann. - 832. By Andrea Cimitan
-
Some fixes to dash layout, especially on the filters pane. Fixes: https:/
/bugs.launchpad .net/bugs/ 906235. Appoved by .
Lohith D Shivamurthy (dyams) wrote : | # |
Haggai, As you might remember, Initially I tested this branch nearly two months ago.
Unfortunately It is not merged yet :(
Very sorry about that. Today when I was reviewing this branch I found three merge conflicts.
(1) Text conflict in launcher/
(2) Contents conflict in places/
(3) Text conflict in places/
Would it be possible for you to resolve them. Please.
Your effort is very much appreciated and very very sorry about the delay. I promise we won't delay it anymore. :)
- 833. By Albert Astals Cid
-
[launcher] Move the RMB menu from clicked to pressed
Fixes LP bug #813036
. Fixes: https://bugs.launchpad .net/bugs/ 813036. Appoved by Lohith D Shivamurthy.
Haggai Eran (haggai-eran) wrote : | # |
Hi,
I've rebased my local branch, and solved the text conflicts, but the contents conflict requires me to make changes to the new FocusPath element. For some reason I can't compile the trunk version of unity-2d. Something about missing unity::
Gerry Boland (gerboland) wrote : | # |
Hi Haggai,
I'll let Lohith instruct you on what you need to do to compile trunk. I want to tell you about why this branch was delayed and what I have in mind.
The high-priority project we've been working is a full User Experience testing suite. The plan is that every MR that fixes bugs and adds features must have tests attached. The changes in this MR are important and very testable, which motivated me to use it as an example case for our automated testing.
More info is available in the tests/README file for now, I've to pad out the documentation.
I plan to write tests for you - you've done enough already - and ask you to merge a branch with my tests into this MR. Then we can approve this MR!
What do you think?
-Gerry
Lohith D Shivamurthy (dyams) wrote : | # |
@Haggai: Thank you very much.
Yes, one of the unity-2d dependencies has changed or rather upgraded to newer version and the that newer version is in staging yet.
Steps you need to follow:
$ sudo rm -f /etc/apt/
$ sudo add-apt-repository ppa:unity-
$ sudo apt-get update
$ sudo apt-get remove libdee-1.0-1 # IMPORTANT! Remove old libdee. Accept the removal of other packages.
$ sudo apt-get upgrade
$ sudo apt-get install libqtdee-dev libunity-
$ sudo apt-get install nautilus # [optional] Nautilus in PPA is held back, this installs it
Please note that this is in a very alpha stage yet, hence it *might* break your desktop sometimes.
@Gerry: Thank you from my side :)
Haggai Eran (haggai-eran) wrote : | # |
@Gerry: I think adding tests is a great idea, especially since RTL desktops aren't commonly used, and testing could help other developers to be aware of their issues. I'm not quite familiar with automated GUI testing, so I'm glad that you plan to write them yourself this time. In the future I could learn from these tests and add them to other MRs.
@Lohith: Thank you for the detailed instructions. I'll try them soon. I'm not worried of breaking the desktop since I'm developing in a virtual machine.
- 838. By Haggai Eran
-
Switch left and right keys when accessing launcher in RTL locale.
- 839. By Haggai Eran
-
[launcher] Mirror the launcher in RTL locales (LP: #854587)
- 840. By Haggai Eran
-
[dash] Fix spacing between elemenets in GridViewWithSpa
cing, in RTL locale. - 841. By Haggai Eran
-
[dash] Mirror the MultiRange filter in RTL locales.
- 842. By Haggai Eran
-
[dash] Fix right-to-left keyboard navigation with the new FocusPath object.
Haggai Eran (haggai-eran) wrote : | # |
Hi,
I've uploaded a rebased version of the branch, without the conflicts, and added a patch to the FocusPath object for correct RTL keyboard navigation.
There is still an issue with the keyboard navigation that I couldn't solve. When the filter is visible, pressing the left key should move the focus from the search bar to the filter. This is supposed to be done automatically by Qt, mirroring the setting for the right key. However, nothing happens when pressing either the left or the right key in the search bar. Pressing right in the filter works fine though.
Lohith D Shivamurthy (dyams) wrote : | # |
Hey Haggai,
Happy New Year :)
Thank you very much. Your branch is very important for us.
As Gerry said already, He is going to write tests for you.
Let us wait for that hence We can merge your branch soon. Thank you.
Albert Astals Cid (aacid) wrote : | # |
This branch does not cleanly merge to master anymore.
Haggai Eran (haggai-eran) wrote : | # |
Ofcourse. Are the tests Gerry wanted to write ready? I'll gladly rebase the branch, but I rather do so with the tests available.
Gerry Boland (gerboland) wrote : | # |
Hey Haggai,
thank you for your patience.
Right now we have LTR and RTL tests for the launcher autohide/show behaviours and dash position & mouse interactions. We need to write plenty more, but they're building up slowly.
The unity2d code has changed quite a bit, and a few more changes are in store, so this MR needs to be re-assessed.
- [launcher] Move the edge hit detector one pixel to the right when in RTL locales (LP: #877292)
I suggest you leave this out for now. We will be replacing the edge hit detector with a pointer barrier, so this change is unnecessary.
- [panel] Change panel window buttons alignment when in RTL locale (LP: #858053)
- [dash] Fix rating stars alignment when in RTL locale.
These two are more visual changes, and are not suited to an automated test. In these cases, we attach a before & after screenshot, so that design can approve the visual change.
- [dash] Switch left and right keys when in RTL locale (LP: #886686)
This change is important, but I'm suspicious of your fix. Switching left<->right keys the only way? Is unity-panel-service not able to manage this itself?
What I suggest you do is split this MR up into smaller bits, perhaps one MR per bug. Then at least we can reduce the number of things to do for proper RTL support.
Many thanks
-Gerry
Haggai Eran (haggai-eran) wrote : | # |
Hi,
Thanks for the feedback. I'll split the MR as you requested. I'm not sure I understand how the switching of left and right keys for dash can be done inside unity-panel-
Regards,
Haggai
Unmerged revisions
- 842. By Haggai Eran
-
[dash] Fix right-to-left keyboard navigation with the new FocusPath object.
- 841. By Haggai Eran
-
[dash] Mirror the MultiRange filter in RTL locales.
- 840. By Haggai Eran
-
[dash] Fix spacing between elemenets in GridViewWithSpa
cing, in RTL locale. - 839. By Haggai Eran
-
[launcher] Mirror the launcher in RTL locales (LP: #854587)
- 838. By Haggai Eran
-
Switch left and right keys when accessing launcher in RTL locale.
- 837. By Haggai Eran
-
[dash] Switch left and right keys when in RTL locale (LP: #886686)
- 836. By Haggai Eran
-
[dash] Fix rating stars alignment when in RTL locale.
- 835. By Haggai Eran
-
[panel] Change panel window buttons alignment when in RTL locale (LP: #858053)
- 834. By Haggai Eran
-
[launcher] Move the edge hit detector one pixel to the right when in RTL locales (LP: #877292)
Preview Diff
1 | === modified file 'launcher/Launcher.qml' | |||
2 | --- launcher/Launcher.qml 2011-12-11 22:26:34 +0000 | |||
3 | +++ launcher/Launcher.qml 2011-12-21 22:46:24 +0000 | |||
4 | @@ -16,7 +16,7 @@ | |||
5 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
6 | 17 | */ | 17 | */ |
7 | 18 | 18 | ||
9 | 19 | import QtQuick 1.0 | 19 | import QtQuick 1.1 |
10 | 20 | import Unity2d 1.0 /* required for drag’n’drop handling */ | 20 | import Unity2d 1.0 /* required for drag’n’drop handling */ |
11 | 21 | 21 | ||
12 | 22 | LauncherDropItem { | 22 | LauncherDropItem { |
13 | @@ -24,6 +24,8 @@ | |||
14 | 24 | 24 | ||
15 | 25 | Accessible.name: "root" | 25 | Accessible.name: "root" |
16 | 26 | focus: true | 26 | focus: true |
17 | 27 | LayoutMirroring.enabled: isRightToLeft() | ||
18 | 28 | LayoutMirroring.childrenInherit: true | ||
19 | 27 | 29 | ||
20 | 28 | function clamp(x, min, max) { | 30 | function clamp(x, min, max) { |
21 | 29 | return Math.max(Math.min(x, max), min) | 31 | return Math.max(Math.min(x, max), min) |
22 | @@ -47,6 +49,24 @@ | |||
23 | 47 | main.positionViewAtBeginning() | 49 | main.positionViewAtBeginning() |
24 | 48 | } | 50 | } |
25 | 49 | 51 | ||
26 | 52 | function isRightToLeft() { | ||
27 | 53 | return Qt.application.layoutDirection == Qt.RightToLeft | ||
28 | 54 | } | ||
29 | 55 | |||
30 | 56 | function switchLeftRightKeys(key) { | ||
31 | 57 | if (isRightToLeft()) { | ||
32 | 58 | switch (key) { | ||
33 | 59 | case Qt.Key_Right: | ||
34 | 60 | return Qt.Key_Left | ||
35 | 61 | case Qt.Key_Left: | ||
36 | 62 | return Qt.Key_Right | ||
37 | 63 | default: | ||
38 | 64 | return key | ||
39 | 65 | } | ||
40 | 66 | } | ||
41 | 67 | return key | ||
42 | 68 | } | ||
43 | 69 | |||
44 | 50 | Item { | 70 | Item { |
45 | 51 | anchors.fill: parent | 71 | anchors.fill: parent |
46 | 52 | clip: true | 72 | clip: true |
47 | 53 | 73 | ||
48 | === modified file 'launcher/LauncherList.qml' | |||
49 | --- launcher/LauncherList.qml 2011-12-21 09:52:15 +0000 | |||
50 | +++ launcher/LauncherList.qml 2011-12-21 22:46:24 +0000 | |||
51 | @@ -187,13 +187,14 @@ | |||
52 | 187 | } | 187 | } |
53 | 188 | 188 | ||
54 | 189 | Keys.onPressed: { | 189 | Keys.onPressed: { |
56 | 190 | if (event.key == Qt.Key_Return || event.key == Qt.Key_Enter || event.key == Qt.Key_Space) { | 190 | var key = switchLeftRightKeys(event.key) |
57 | 191 | if (key == Qt.Key_Return || key == Qt.Key_Enter || key == Qt.Key_Space) { | ||
58 | 191 | item.menu.hide() | 192 | item.menu.hide() |
59 | 192 | item.activate() | 193 | item.activate() |
60 | 193 | event.accepted = true | 194 | event.accepted = true |
61 | 194 | } | 195 | } |
64 | 195 | else if (event.key == Qt.Key_Right || | 196 | else if (key == Qt.Key_Right || |
65 | 196 | (event.key == Qt.Key_F10 && (event.modifiers & Qt.ShiftModifier))) { | 197 | (key == Qt.Key_F10 && (event.modifiers & Qt.ShiftModifier))) { |
66 | 197 | /* Show the menu first, then unfold it. Doing things in this | 198 | /* Show the menu first, then unfold it. Doing things in this |
67 | 198 | order is required because at the moment the code path that | 199 | order is required because at the moment the code path that |
68 | 199 | adjusts the position of the menu in case it goes offscreen | 200 | adjusts the position of the menu in case it goes offscreen |
69 | @@ -204,7 +205,7 @@ | |||
70 | 204 | item.menu.setFocus() | 205 | item.menu.setFocus() |
71 | 205 | event.accepted = true | 206 | event.accepted = true |
72 | 206 | } | 207 | } |
74 | 207 | else if (event.key == Qt.Key_Left) { | 208 | else if (key == Qt.Key_Left) { |
75 | 208 | item.menu.hide() | 209 | item.menu.hide() |
76 | 209 | event.accepted = true | 210 | event.accepted = true |
77 | 210 | } | 211 | } |
78 | 211 | 212 | ||
79 | === modified file 'libunity-2d-private/src/edgehitdetector.cpp' | |||
80 | --- libunity-2d-private/src/edgehitdetector.cpp 2011-11-29 11:46:34 +0000 | |||
81 | +++ libunity-2d-private/src/edgehitdetector.cpp 2011-12-21 22:46:24 +0000 | |||
82 | @@ -58,7 +58,7 @@ | |||
83 | 58 | if (QApplication::isLeftToRight()) { | 58 | if (QApplication::isLeftToRight()) { |
84 | 59 | m_mouseArea->setGeometry(rect.left(), rect.top(), 1, rect.height()); | 59 | m_mouseArea->setGeometry(rect.left(), rect.top(), 1, rect.height()); |
85 | 60 | } else { | 60 | } else { |
87 | 61 | m_mouseArea->setGeometry(rect.right() - 1, rect.top(), 1, rect.height()); | 61 | m_mouseArea->setGeometry(rect.right(), rect.top(), 1, rect.height()); |
88 | 62 | } | 62 | } |
89 | 63 | } | 63 | } |
90 | 64 | 64 | ||
91 | 65 | 65 | ||
92 | === modified file 'libunity-2d-private/src/focuspath.cpp' | |||
93 | --- libunity-2d-private/src/focuspath.cpp 2011-11-21 18:57:43 +0000 | |||
94 | +++ libunity-2d-private/src/focuspath.cpp 2011-12-21 22:46:24 +0000 | |||
95 | @@ -22,6 +22,7 @@ | |||
96 | 22 | #include <QtCore/qmath.h> | 22 | #include <QtCore/qmath.h> |
97 | 23 | #include <QEvent> | 23 | #include <QEvent> |
98 | 24 | #include <QKeyEvent> | 24 | #include <QKeyEvent> |
99 | 25 | #include <QApplication> | ||
100 | 25 | 26 | ||
101 | 26 | /*! | 27 | /*! |
102 | 27 | \qmlclass FocusPath | 28 | \qmlclass FocusPath |
103 | @@ -297,12 +298,25 @@ | |||
104 | 297 | switch(event->type()) { | 298 | switch(event->type()) { |
105 | 298 | case QEvent::KeyPress: { | 299 | case QEvent::KeyPress: { |
106 | 299 | int nextFocus = m_currentIndex; | 300 | int nextFocus = m_currentIndex; |
107 | 301 | Flow flow = m_flow; | ||
108 | 302 | if (QApplication::isRightToLeft()) { | ||
109 | 303 | switch (m_flow) { | ||
110 | 304 | case FocusPath::LeftToRight: | ||
111 | 305 | flow = FocusPath::RightToLeft; | ||
112 | 306 | break; | ||
113 | 307 | case FocusPath::RightToLeft: | ||
114 | 308 | flow = FocusPath::LeftToRight; | ||
115 | 309 | break; | ||
116 | 310 | default: | ||
117 | 311 | break; | ||
118 | 312 | } | ||
119 | 313 | } | ||
120 | 300 | 314 | ||
121 | 301 | QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); | 315 | QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); |
122 | 302 | switch(keyEvent->key()) { | 316 | switch(keyEvent->key()) { |
123 | 303 | case Qt::Key_Right: | 317 | case Qt::Key_Right: |
124 | 304 | if ((m_direction & FocusPath::Horizontal) == FocusPath::Horizontal) { | 318 | if ((m_direction & FocusPath::Horizontal) == FocusPath::Horizontal) { |
126 | 305 | switch(m_flow) { | 319 | switch(flow) { |
127 | 306 | case FocusPath::LeftToRight: | 320 | case FocusPath::LeftToRight: |
128 | 307 | nextFocus += 1; | 321 | nextFocus += 1; |
129 | 308 | break; | 322 | break; |
130 | @@ -319,7 +333,7 @@ | |||
131 | 319 | break; | 333 | break; |
132 | 320 | case Qt::Key_Left: | 334 | case Qt::Key_Left: |
133 | 321 | if ((m_direction & FocusPath::Horizontal) == FocusPath::Horizontal) { | 335 | if ((m_direction & FocusPath::Horizontal) == FocusPath::Horizontal) { |
135 | 322 | switch(m_flow) { | 336 | switch(flow) { |
136 | 323 | case FocusPath::LeftToRight: | 337 | case FocusPath::LeftToRight: |
137 | 324 | nextFocus -= 1; | 338 | nextFocus -= 1; |
138 | 325 | break; | 339 | break; |
139 | @@ -336,14 +350,14 @@ | |||
140 | 336 | break; | 350 | break; |
141 | 337 | case Qt::Key_Up: | 351 | case Qt::Key_Up: |
142 | 338 | if (((m_direction & FocusPath::Vertical) == FocusPath::Vertical) && (m_columns >= 0)) { | 352 | if (((m_direction & FocusPath::Vertical) == FocusPath::Vertical) && (m_columns >= 0)) { |
144 | 339 | nextFocus = (m_flow == FocusPath::TopToBottom) ? nextFocus - 1 : nextFocus - m_columns; | 353 | nextFocus = (flow == FocusPath::TopToBottom) ? nextFocus - 1 : nextFocus - m_columns; |
145 | 340 | } else { | 354 | } else { |
146 | 341 | nextFocus = -1; | 355 | nextFocus = -1; |
147 | 342 | } | 356 | } |
148 | 343 | break; | 357 | break; |
149 | 344 | case Qt::Key_Down: | 358 | case Qt::Key_Down: |
150 | 345 | if (((m_direction & FocusPath::Vertical) == FocusPath::Vertical) && (m_columns >= 0)) { | 359 | if (((m_direction & FocusPath::Vertical) == FocusPath::Vertical) && (m_columns >= 0)) { |
152 | 346 | nextFocus = (m_flow == FocusPath::TopToBottom) ? nextFocus + 1 : nextFocus + m_columns; | 360 | nextFocus = (flow == FocusPath::TopToBottom) ? nextFocus + 1 : nextFocus + m_columns; |
153 | 347 | } else { | 361 | } else { |
154 | 348 | nextFocus = -1; | 362 | nextFocus = -1; |
155 | 349 | } | 363 | } |
156 | 350 | 364 | ||
157 | === modified file 'libunity-2d-private/src/launchermenu.cpp' | |||
158 | --- libunity-2d-private/src/launchermenu.cpp 2011-12-05 06:49:40 +0000 | |||
159 | +++ libunity-2d-private/src/launchermenu.cpp 2011-12-21 22:46:24 +0000 | |||
160 | @@ -331,7 +331,9 @@ | |||
161 | 331 | LauncherContextualMenu::keyPressEvent(QKeyEvent* event) | 331 | LauncherContextualMenu::keyPressEvent(QKeyEvent* event) |
162 | 332 | { | 332 | { |
163 | 333 | int key = event->key(); | 333 | int key = event->key(); |
165 | 334 | if (key == Qt::Key_Left || key == Qt::Key_Escape) { | 334 | bool rtl = layoutDirection() == Qt::RightToLeft; |
166 | 335 | if (!rtl && key == Qt::Key_Left || | ||
167 | 336 | rtl && key == Qt::Key_Right || key == Qt::Key_Escape) { | ||
168 | 335 | Q_EMIT dismissedByKeyEvent(); | 337 | Q_EMIT dismissedByKeyEvent(); |
169 | 336 | hide(); | 338 | hide(); |
170 | 337 | event->accept(); | 339 | event->accept(); |
171 | 338 | 340 | ||
172 | === modified file 'panel/applets/appname/appnameapplet.cpp' | |||
173 | --- panel/applets/appname/appnameapplet.cpp 2011-12-02 06:41:22 +0000 | |||
174 | +++ panel/applets/appname/appnameapplet.cpp 2011-12-21 22:46:24 +0000 | |||
175 | @@ -111,8 +111,10 @@ | |||
176 | 111 | } else { | 111 | } else { |
177 | 112 | pix = m_normalPix; | 112 | pix = m_normalPix; |
178 | 113 | } | 113 | } |
179 | 114 | bool rtl = layoutDirection() == Qt::RightToLeft; | ||
180 | 114 | int posX; | 115 | int posX; |
182 | 115 | if (m_buttonType == PanelStyle::CloseWindowButton) { | 116 | if (!rtl && m_buttonType == PanelStyle::CloseWindowButton || |
183 | 117 | rtl && m_buttonType != PanelStyle::CloseWindowButton) { | ||
184 | 116 | posX = width() - pix.width(); | 118 | posX = width() - pix.width(); |
185 | 117 | } else { | 119 | } else { |
186 | 118 | posX = 0; | 120 | posX = 0; |
187 | 119 | 121 | ||
188 | === modified file 'places/GridViewWithSpacing.qml' | |||
189 | --- places/GridViewWithSpacing.qml 2011-08-23 15:00:31 +0000 | |||
190 | +++ places/GridViewWithSpacing.qml 2011-12-21 22:46:24 +0000 | |||
191 | @@ -25,6 +25,8 @@ | |||
192 | 25 | property int rows: 2 | 25 | property int rows: 2 |
193 | 26 | 26 | ||
194 | 27 | function delegateX(column) { | 27 | function delegateX(column) { |
195 | 28 | if (isRightToLeft()) | ||
196 | 29 | column = columns - 1 - column | ||
197 | 28 | return column * horizontalSpacing / columns | 30 | return column * horizontalSpacing / columns |
198 | 29 | } | 31 | } |
199 | 30 | function delegateY(row) { | 32 | function delegateY(row) { |
200 | 31 | 33 | ||
201 | === modified file 'places/LensBar.qml' | |||
202 | --- places/LensBar.qml 2011-12-14 22:46:59 +0000 | |||
203 | +++ places/LensBar.qml 2011-12-21 22:46:24 +0000 | |||
204 | @@ -74,7 +74,7 @@ | |||
205 | 74 | } | 74 | } |
206 | 75 | 75 | ||
207 | 76 | function handleKeyPress(key) { | 76 | function handleKeyPress(key) { |
209 | 77 | switch (key) { | 77 | switch (switchLeftRightKeys(key)) { |
210 | 78 | case Qt.Key_Right: | 78 | case Qt.Key_Right: |
211 | 79 | return selectChild(currentIndex+1) | 79 | return selectChild(currentIndex+1) |
212 | 80 | case Qt.Key_Left: | 80 | case Qt.Key_Left: |
213 | 81 | 81 | ||
214 | === modified file 'places/MultiRangeSelectionBar.qml' | |||
215 | --- places/MultiRangeSelectionBar.qml 2011-08-25 10:46:14 +0000 | |||
216 | +++ places/MultiRangeSelectionBar.qml 2011-12-21 22:46:24 +0000 | |||
217 | @@ -16,7 +16,7 @@ | |||
218 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
219 | 17 | */ | 17 | */ |
220 | 18 | 18 | ||
222 | 19 | import QtQuick 1.0 | 19 | import QtQuick 1.1 |
223 | 20 | 20 | ||
224 | 21 | Item { | 21 | Item { |
225 | 22 | id: multiRangeSelectionBar | 22 | id: multiRangeSelectionBar |
226 | @@ -26,7 +26,7 @@ | |||
227 | 26 | property int leftPos: 0 | 26 | property int leftPos: 0 |
228 | 27 | property int rightPos: 100 | 27 | property int rightPos: 100 |
229 | 28 | 28 | ||
231 | 29 | x: leftPos | 29 | x: !isRightToLeft() ? leftPos : parent.width - rightPos |
232 | 30 | width: rightPos - leftPos | 30 | width: rightPos - leftPos |
233 | 31 | height: childrenRect.height | 31 | height: childrenRect.height |
234 | 32 | 32 | ||
235 | @@ -38,6 +38,7 @@ | |||
236 | 38 | height: sourceSize.height | 38 | height: sourceSize.height |
237 | 39 | anchors.left: parent.left | 39 | anchors.left: parent.left |
238 | 40 | anchors.top: parent.top | 40 | anchors.top: parent.top |
239 | 41 | mirror: isRightToLeft() | ||
240 | 41 | } | 42 | } |
241 | 42 | 43 | ||
242 | 43 | Image { | 44 | Image { |
243 | @@ -59,6 +60,7 @@ | |||
244 | 59 | height: sourceSize.height | 60 | height: sourceSize.height |
245 | 60 | anchors.top: parent.top | 61 | anchors.top: parent.top |
246 | 61 | anchors.right: parent.right | 62 | anchors.right: parent.right |
247 | 63 | mirror: isRightToLeft() | ||
248 | 62 | } | 64 | } |
249 | 63 | 65 | ||
250 | 64 | } | 66 | } |
251 | 65 | 67 | ||
252 | === modified file 'places/RatingStars.qml' | |||
253 | --- places/RatingStars.qml 2011-11-14 10:45:33 +0000 | |||
254 | +++ places/RatingStars.qml 2011-12-21 22:46:24 +0000 | |||
255 | @@ -50,7 +50,7 @@ | |||
256 | 50 | 50 | ||
257 | 51 | Keys.onPressed: if (handleKeyPress(event.key)) event.accepted = true | 51 | Keys.onPressed: if (handleKeyPress(event.key)) event.accepted = true |
258 | 52 | function handleKeyPress(key) { | 52 | function handleKeyPress(key) { |
260 | 53 | switch (key) { | 53 | switch (switchLeftRightKeys(key)) { |
261 | 54 | case Qt.Key_Right: | 54 | case Qt.Key_Right: |
262 | 55 | incrementRating() | 55 | incrementRating() |
263 | 56 | return true | 56 | return true |
264 | @@ -64,6 +64,9 @@ | |||
265 | 64 | Row { | 64 | Row { |
266 | 65 | id: stars | 65 | id: stars |
267 | 66 | 66 | ||
268 | 67 | // Required for right-to-left mirroring | ||
269 | 68 | anchors.left: parent.left | ||
270 | 69 | |||
271 | 67 | Repeater { | 70 | Repeater { |
272 | 68 | model: size | 71 | model: size |
273 | 69 | Star { | 72 | Star { |
274 | @@ -98,6 +101,8 @@ | |||
275 | 98 | 101 | ||
276 | 99 | /* What unit is the mouse over? This is the integer part of the rating (plus one)*/ | 102 | /* What unit is the mouse over? This is the integer part of the rating (plus one)*/ |
277 | 100 | var rating = (posX - posXOverUnit) / unitWidth + 1 | 103 | var rating = (posX - posXOverUnit) / unitWidth + 1 |
278 | 104 | if (isRightToLeft()) | ||
279 | 105 | rating = size + 1 - rating | ||
280 | 101 | 106 | ||
281 | 102 | return clamp( rating, 0, size ) | 107 | return clamp( rating, 0, size ) |
282 | 103 | } | 108 | } |
283 | 104 | 109 | ||
284 | === modified file 'places/dash.qml' | |||
285 | --- places/dash.qml 2011-12-19 10:44:26 +0000 | |||
286 | +++ places/dash.qml 2011-12-21 22:46:24 +0000 | |||
287 | @@ -33,6 +33,20 @@ | |||
288 | 33 | return Qt.application.layoutDirection == Qt.RightToLeft | 33 | return Qt.application.layoutDirection == Qt.RightToLeft |
289 | 34 | } | 34 | } |
290 | 35 | 35 | ||
291 | 36 | function switchLeftRightKeys(key) { | ||
292 | 37 | if (isRightToLeft()) { | ||
293 | 38 | switch (key) { | ||
294 | 39 | case Qt.Key_Right: | ||
295 | 40 | return Qt.Key_Left | ||
296 | 41 | case Qt.Key_Left: | ||
297 | 42 | return Qt.Key_Right | ||
298 | 43 | default: | ||
299 | 44 | return key | ||
300 | 45 | } | ||
301 | 46 | } | ||
302 | 47 | return key | ||
303 | 48 | } | ||
304 | 49 | |||
305 | 36 | Binding { | 50 | Binding { |
306 | 37 | target: dashView | 51 | target: dashView |
307 | 38 | property: "expanded" | 52 | property: "expanded" |
Hi Haggai,
this looks great, but I found one thing you should fix:
1. In RTL, press Alt+F1, the Launcher appears
2. Press down to select nautilus
3. Press the left arrow key
Expected Result
Context menu appears
Actual Result LauncherList. qml, lines 188 & 200.
Nothing happens. The right arrow key opens the menu. Have a look in launcher/