Status: | Merged |
---|---|
Approved by: | Florian Boucault |
Approved revision: | 731 |
Merged at revision: | 731 |
Proposed branch: | lp:~mardy/unity-2d/rtl |
Merge into: | lp:unity-2d |
Diff against target: |
599 lines (+217/-31) 16 files modified
launcher/LauncherItem.qml (+9/-1) launcher/app/launcher.cpp (+1/-0) libunity-2d-private/Unity2d/launchermenu/launchermenu.qrc (+6/-0) libunity-2d-private/Unity2d/launchermenu/launchermenu_rtl.css (+82/-0) libunity-2d-private/src/edgehitdetector.cpp (+9/-3) libunity-2d-private/src/intellihidebehavior.cpp (+11/-1) libunity-2d-private/src/launchermenu.cpp (+34/-8) libunity-2d-private/src/unity2dapplication.cpp (+7/-0) libunity-2d-private/src/unity2dpanel.cpp (+17/-6) panel/app/main.cpp (+0/-4) panel/app/panelmanager.cpp (+5/-1) panel/applets/appname/appnameapplet.cpp (+5/-1) panel/applets/appname/croppedlabel.cpp (+9/-4) places/SearchEntry.qml (+3/-0) places/app/dashdeclarativeview.cpp (+10/-1) places/dash.qml (+9/-1) |
To merge this branch: | bzr merge lp:~mardy/unity-2d/rtl |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Florian Boucault (community) | Approve | ||
Review via email: mp+71305@code.launchpad.net |
Commit message
Description of the change
Mirror layouts and panels' placement for RTL locales
* Move the launcher to the right of the screen, and mirror it.
* Mirror the layout of the top panel.
* Mirror the layout of the dash.
Original contribution by Haggai Eran.
- 650. By Florian Boucault
-
Removed mistakenly introduced dependency on libdee.
- 651. By Florian Boucault
-
Readded dependency on libdee as a workaround until the proper fix is made in UnityCore.
- 652. By Gerry Boland
-
[dash] Fix Lens bar icons so they scale correctly. Use correct Home lens icon.
- 653. By Florian Boucault
-
Merged lp:unity-2d
- 654. By Florian Boucault
-
* No change rebuild for the nux update abi break
* debian/control: update the nux requirement to be sure to pick the new one - 655. By Gerry Boland
-
[dash] (Unity 4.0) Update Toggle buttons to latest design spec
- 656. By Alberto Mardegan
-
Add missing initializations of member variables
These were reported by valgrind complaining about "jump depends on value of uninitialized variable".
- 657. By Florian Boucault
-
[dash] Collapse categories by default.
- 658. By Ugo Riboni
-
[panel] Dynamically load applets
Each applet is now a plugin implementing the PanelAppletProv
iderInterface.
In addition to porting the existing applets as plugins, the Homebutton and
Separator applets have been brought back as optional panel applets. - 659. By Florian Boucault
-
Merged lp:unity-2d
- 660. By Florian Boucault
-
Merged lp:unity-2d
- 661. By Alberto Mardegan
-
[panel] IndicatorsManager: deliver synthetic mouse motion events to Qt
By feeding mouse motion events to Qt while the panel-service is grabbing the
mouse, we ensure that Qt can generate correct enter/leave events for the panel
widgets (and especially for the IndicatorEntry widgets).
Florian Boucault (fboucault) wrote : | # |
Style: by convention all if statements use braces. For example:
if (true)
do this
else
do that
is actually written:
if (true) {
do this
} else {
do that
}
See CODING file.
Florian Boucault (fboucault) wrote : | # |
In QML, there should be only one space between the property and its value. For example:
Item {
x: 24
}
should be written:
Item {
x: 24
}
- 662. By Florian Boucault
-
[dash] Removed unused tile renderers and simplified conversion of renderer name to QML file name.
- 663. By Florian Boucault
-
[launcher] Rename dash tile to 'Dash home'.
- 664. By Florian Boucault
-
Merged lp:unity-2d
- 665. By Florian Boucault
-
Merged lp:unity-2d
- 666. By Florian Boucault
-
[packaging] Install javascript files as well.
- 667. By Florian Boucault
-
[dash] New filters pane on the right hand side of the search results.
Implemented filters:
- multirange
- checkoption
- ratings - 668. By Florian Boucault
-
[i18n] Updated translation catalog.
- 669. By Florian Boucault
-
[packaging] debian/changelog: added placeholder entry.
- 670. By Sebastien Bacher
-
* New upstream release:
- [panel] application menus do not appear on first hover after dismissal
(lp: #825262)
- [dash] Lens icons badly scaled (lp: #825368)
- [panel] indicators are shifted offscreen to the right (lp: #827673)
- [panel] scrubbing from system indicators to menubar should be possible
(lp: #706903)
- [launcher] Closed applications don't get their launcher counts cleared
(lp: #767367)
- [dash] selected item should not be underlined but use the same
treatment as unity (lp: #817456)
- [dash] categories should be collapsed by default (lp: #827214)
- [dash] Ratings filter (lp: #831855)
- [dash] Multirange filter (lp: #831856)
- [dash] ToggleButton filter (lp: #831857)
- [dash] Icon size must be bigger to match the mockups (lp: #831858)
- [dash] "Refine search" right margin should be 15 pixels (lp: #832058)
- [dash] "Refine search" should be "Filter results" (lp: #832060)
- [dash] Font sizes should match new design (lp: #832114)
- [panel] Glitch: application menu appearing when pressing the BFB
(lp: #825060)
- [panel] Glitch: application menus are quickly opened after a drag gesture
(lp: #825267)
- [dash] File thumbnails aspect ratio is not respected (lp: #832204) - 671. By Sebastien Bacher
-
debian/control: require current the current versions of nux and unity
- 672. By Sebastien Bacher
-
releasing version 4.2.0-0ubuntu1
Alberto Mardegan (mardy) wrote : | # |
I fixed the style issues, but the warnings cannot be easily fixed.
I filed a bug against Qt for that: https:/
If my understanding is correct, these warnings don't point at any real problem; any ideas on how to suppress them is welcome (we could add a property layoutDirectionHack to the DashDeclarativeView class, having also a NOTIFY signal, but maybe there's something better?).
- 673. By Alberto Mardegan
-
[panel] Workaround QConf incomplete destruction
Ensure that the QConf object stays alive as long as the PanelManager is. This
is to workaround an issue with QConf's destructor, which doesn't disconnect
from the DConf's "notify" signal that can later be emitted while running the
event loop, and would therefore attempt to operate on an already destroyed
object. - 674. By Gerry Boland
-
[dash] Rating Stars now cleared when "All" button pressed. Fixes bug:834640
- 675. By Alberto Mardegan
-
[panel] Padding for indicators should be 5 pixels
- 676. By Gerry Boland
-
[launcher] Context menu arrow has ugly blue edge. Harder to observe is that all the background graphics have blu-ish edges. This commit cleans up the graphics. Fixes bug:828386
- 677. By Alberto Mardegan
-
[dash] Convert UnityCore UTF-8 strings to QStrings
Add a tiny global function to perform the conversion, and use it throughout the project.
- 678. By Florian Boucault
-
[dash] Category header label changed from using literal to numeral: "See one more result" changed into "See 1 more result"
- 679. By Florian Boucault
-
[dash][launcher] When an application has no icon or the icon fails to load, display a placeholder icon.
- 680. By Florian Boucault
-
[dash] Use plural form in category header label 'See x more results'
- 681. By Florian Boucault
-
[dash] Fixed drag and drop of results from the dash (in particular applications to the launcher).
- 682. By Florian Boucault
-
[dash] Support loading lens' icon from theme in lens navigation bar.
- 683. By Florian Boucault
-
[dash] Fallback to using the default renderer if renderer requested by the lens is not found.
- 684. By Florian Boucault
-
[dash] Added horizontal renderer used by lenses such as Gwibber.
- 685. By Florian Boucault
-
[dash] Home buttons 'Media' and 'Internet' apps now also activate the right filter and open up the 'Filter results' pane.
Alberto Mardegan (mardy) wrote : | # |
Here's a couple of changes to avoid the warnings: instead of using the layoutDirection property from the DashDeclarative
Files changed since last review: places/dash.qml, places/
- 686. By Florian Boucault
-
[panel] legacytray applet: implement a whitelist of applications that are allowed to be shown.
Whitelist is shared with Unity 3D and stored in D-Conf.
- 687. By Gerry Boland
-
[launcher] Fix keyboard shortcuts to start counting applications at index 1.
- 688. By Florian Boucault
-
[packaging] Added placeholder entry to debian/changelog.
- 689. By Gerry Boland
-
[dash] HACK: the DropShadow effect on the Home lensButton causes visual artifacts as the list of lenses is being populated, when the inter-lensButton spacing is non-zero. Can work around this by removing spacing and instead add padding to each lensButton. Fixes bug:833805
- 690. By Florian Boucault
-
[dash] Make sure that a search with the empty string ("") is sent to the lenses
when connecting to them. This is part of the fix necessary for bug #834571, the
other part being in libunity. - 691. By Didier Roche-Tolomelli
-
* New upstream release:
* debian/control:
- require current nux and unity - 692. By Didier Roche-Tolomelli
-
- unity-2d-panel crashed with SIGSEGV in QConfSchema:
:findKey( )
(LP: #834045)
- unity-2d-panel crashed with SIGSEGV in QConf::notify() (LP: #834001)
- [panel] Implement whitelisting for legacy tray applet (LP: #707354)
- [launcher] stops automatically hiding after some time using it
(LP: #821180)
- [panel] Empathy displays icon in deprecated systray (LP: #830017)
- [dash] Invalid UTF-8 in the dash (LP: #836587)
- [dash] Home buttons 'Media' and 'Internet' apps should not only take you
to the apps lens but also activate the right filter (LP: #837360)
- [dash] Drag&drop application from dash to launcher is broken
(LP: #837361)
- [launcher] contextual menu's corner has a blue line (LP: #828386)
- [dash] Lens bar graphical layout glitches (LP: #833805)
- [dash] Rating Filter: All button not clearing star highlighting
(LP: #834640)
- [dash] should be falling back to the default renderer if the renderer
requested by the lens is not found (LP: #837356)
- [dash] Gwibber lens icon doesn't show up in 2d unity (LP: #830728)
- [dash] Lacks horizontal renderer used by lenses such as Gwibber
(LP: #837712)
- [dash] See %1 more result inconsistency (LP: #834226)
- [launcher] When application has no icon, a question mark icon should be
displayed (LP: #837351)
- unity places should return a default icon when no matching icon is found
(LP: #711200)
- spacing between indicators should be 5 pixels (LP: #734010) - 693. By Didier Roche-Tolomelli
-
releasing version 4.4.0-0ubuntu1
- 694. By Aurélien Gâteau
-
[Launcher] Use the same icon as Unity 3d for the BFB launcher item
- 695. By Florian Boucault
-
[dash] Fix encoding and decoding of strings coming from and passed to the backend so that searches containing non-ascii characters work.
Reverted revision 677. It was introducing QStringFromUtf8
StdString that has
the same result as QString::fromStdString with the codec for C-strings set to UTF-8. - 696. By Didier Roche-Tolomelli
-
[launcher] Migrate favorites as in unity before building the launcher applications list
(LP: #819733) - 697. By Alberto Mardegan
-
[places] Use shotwell as default photo viewer
Extend GioDefaultAppli
cation with a defaultDesktopFile property which can be
used to override the default application registered for the content-type. - 698. By Gerry Boland
-
[launcher] Qt4.7.4 fixes a bug we were using, where ListView was not explicitly attached to the root of the delegate. (See https:/
/bugreports. qt.nokia. com/browse/ QTBUG-19557). This commit fixes the launcher to work correctly with this change.
- 699. By Florian Boucault
-
[panel] Show window control buttons whenever the application menu is shown and the window is maximised.
- 700. By Andrea Grandi
-
Emptying the trash by right-clicking the trash icon in the unity sidebar and selecting the "Empty ..." option requires users to confirm the action, even if they have unchecked the "Ask before emptying ..." option in nautilus > Edit > Preferences > Behaviour. The option is correctly applied to emptying the trash from nautilus itself.
Now this behaviour is respected in Unity-2D too.
- 701. By Gerry Boland
-
[launcher] Unity uses the Trash icon supplied by the default theme. Unity2D now does the same.
- 702. By Ugo Riboni
-
Add a new proxy model class that excludes items matching the regexp instead of including them.
- 703. By Gerry Boland
-
[dash] RatingStars should only allow whole stars to be selected. See bug:839759
- 704. By Alberto Mardegan
-
[launcher, dash, workspace switcher] Added a configuration key to enable QML's OpenGL backend
- 705. By Gerry Boland
-
[dash] DropShadow can cause visual artifacts in the GridView while it is being moved. Work around this by disabling DropShadow while Grid is being moved.
- 706. By Florian Boucault
-
Simplify implementation of QSortFilterProx
yModel' s count property by overriding the filterAcceptRow method as recommended by the documentation. - 707. By Marco Trevisan (Treviño)
-
To implement the Desktop DX Indicators Review blueprint [1] and to implement the system indicators ordering requested by design team [2], I've redesigned the way the indicators work in unity.
This need to change both unity-panel-
service, UnityCore and unity-2d-panel, and basically it works by making the panel-service to compute a "priority" for each indicator entry and then making the panel to show the indicator entries in the correct order. This needs the UnityCore code available in the lp:~3v1n0/unity/indicators-redesign branch.
More informations are available in the unity merge request:
https://code.launchpad .net/~3v1n0/ unity/indicator s-redesign/ +merge/ 70818 [1] https:/
/blueprints. launchpad. net/ubuntu/ +spec/desktop- dx-o-indicators -review
[2] https://wiki.ubuntu. com/MenuBar# System_ status_ menus_. 28system_ indicators. 29 PS: Unfortunately I will go in holiday on August 11th, so I hope you could review it quickly to allow me to fix the eventual issues.
- 708. By Didier Roche-Tolomelli
-
* debian/control:
- rebuild against current nux and unity (API change) - 709. By Didier Roche-Tolomelli
-
* New upstream release
- [dash] Apps lens shows no result by default (LP: #834571)
- Metacity needs command line options to activate capture before unmap and
compositing without effects (LP: #791205)
- Bold fonts everywhere in the UI (dash, launcher, workspace switcher) but
in the panel (LP: #808849)
- the migration script needs to be run in unity-2d as well (LP: #819733)
- [dash] "View photos" in the dash launches default image viewer instead
of shotwell (LP: #822605)
- Launcher tooltips sometimes leave holes in panel and windows
(LP: #837277)
- [dash] Search with non ascii characters fails (LP: #840010)
- add a configuration key (dconf) to enable the opengl backend
(LP: #809202)
- [launcher] when pressing super key shortcuts numbering start at 2
instead of 1 (LP: #830036)
- [UIFe] Unity 2D should be using the same BFB icon as Unity (LP: #838829)
- [launcher] trash icon needs to be the same as in Unity 3D (LP: #840025)
- Pressing alt on maximized window does show menu but not window controls
(LP: #836274)
- [dash] DropShadow on "See X more results" can cause visual errors on
scroll (LP: #843820)
- Dash - In the App lens filters, users should only be able filter by
'star' rating in one star increments (LP: #839759)
- Emptying the trash from the unity sidebar should respect nautilus' "Ask
before emptying" setting (LP: #730003)
- UIFe: Panel - Indicators should be orderable regardless of their parent
IndicatorObject (LP: #823061) - 710. By Didier Roche-Tolomelli
-
macro release for unity
- 711. By Didier Roche-Tolomelli
-
releasing version 4.6.0-0ubuntu1
- 712. By Florian Boucault
-
[dash] Lenses Qt binding's querying of unity::
dash::Lenses: :count property caused
a SEGFAULT. Avoid using that property. - 713. By Didier Roche-Tolomelli
-
Fix a segfault due to new unity service backend change.
- 714. By Didier Roche-Tolomelli
-
releasing version 4.6.1-0ubuntu1
- 715. By Florian Boucault
-
[dash] Fixed issue where no results are displayed by default in any lens.
Synchronized local states of lenses with their actual states when they become
connected. - 716. By Marco Trevisan (Treviño)
-
[panel] Added support for the missing indicator removal feature.
When the on_object_removed signal is emitted, unity-2d should remove the given indicator and its entries from the panel.
- 717. By Florian Boucault
-
[panel] Fixed crash occuring in IndicatorsWidge
t::onEntryRemov ed() when logging out. During IndicatorsWidget's destruction, disconnect from indicators' signals that it was connected to.
- 718. By Michał Sawicz
-
[launcher] Fix interaction with the window manager
When launching a new application, we need to forward a proper timestamp from the X server so that the window manager can successfully do focus stealing prevention.
- 719. By Florian Boucault
-
[dash] Made lens navigation bar buttons accessible.
- 720. By Florian Boucault
-
[dash] Do not display the search hint in the search field when a partial input is available from an input method.
Only works with Qt Quick 1.1.
- 721. By Gerry Boland
-
[panel] Fix line of bad pixels above panel. See bug:846335
- 722. By Alberto Mardegan
-
Merge
- 723. By Alberto Mardegan
-
Use mirroring in LauncherItem
- 724. By Alberto Mardegan
-
remove debug line
- 725. By Alberto Mardegan
-
Remove empty line
- 726. By Alberto Mardegan
-
Use mirroring in dash
- 727. By Alberto Mardegan
-
Remove unused dependency
- 728. By Alberto Mardegan
-
Remove useless line
Alberto Mardegan (mardy) wrote : | # |
Branch reworked a bit to take the Qt 4.7.4 layout mirroring into use.
Florian Boucault (fboucault) wrote : | # |
* arrow_rtl.png is not an exact mirror of arrow.png because arrow.png has had an update recently
* panel/CMakeList
* Individual changes to places.cpp, launcher.cpp, etc. should be factored in Unity2dApplication:
Unity2dTr:
if (u2dTr(
}
Florian Boucault (fboucault) wrote : | # |
This is great work! There is a couple of functional issues that we can either fix now or report as bugs:
- the launcher has a 1 pixel wide gray-ish vertical line on its right-handside which is fine in LTR but it should move to the left hand-side in RTL
- the workspace switcher leaves a space for the launcher always on the left even though in RTL the launcher is on the right
- 729. By Alberto Mardegan
-
Update arrow icon for RTL locales
- 730. By Alberto Mardegan
-
Remove unused artwork
- 731. By Alberto Mardegan
-
Remove code duplication
Alberto Mardegan (mardy) wrote : | # |
I took care of the issues you mentioned, except the last two; it might take a longer time to fix those, and I'd rather have this basic support in first.
Florian Boucault (fboucault) wrote : | # |
All good, please file bug reports for these when you have more time.
Florian Boucault (fboucault) wrote : | # |
The release team agreed to merge it as a freeze exception given that it's not activated by default which I believe is the case.
Preview Diff
1 | === modified file 'launcher/LauncherItem.qml' |
2 | --- launcher/LauncherItem.qml 2011-09-05 13:59:41 +0000 |
3 | +++ launcher/LauncherItem.qml 2011-09-20 08:46:25 +0000 |
4 | @@ -16,7 +16,7 @@ |
5 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
6 | */ |
7 | |
8 | -import QtQuick 1.0 |
9 | +import QtQuick 1.1 |
10 | import Unity2d 1.0 |
11 | |
12 | /* This component represents a single "tile" in the launcher and the surrounding |
13 | @@ -95,6 +95,10 @@ |
14 | else return (index == 0) ? 0 : (index == 1) ? -4 : +4 |
15 | } |
16 | |
17 | + function isRightToLeft() { |
18 | + return Qt.application.layoutDirection == Qt.RightToLeft |
19 | + } |
20 | + |
21 | signal clicked(variant mouse) |
22 | signal entered |
23 | signal exited |
24 | @@ -102,6 +106,8 @@ |
25 | Item { |
26 | /* The actual item, reparented so its y coordinate can be animated. */ |
27 | id: looseItem |
28 | + LayoutMirroring.enabled: isRightToLeft() |
29 | + LayoutMirroring.childrenInherit: true |
30 | parent: list |
31 | width: item.width |
32 | height: item.height |
33 | @@ -127,6 +133,7 @@ |
34 | Image { |
35 | anchors.right: parent.right |
36 | y: item.height - item.tileSize / 2 - height / 2 |
37 | + mirror: isRightToLeft() |
38 | |
39 | source: "image://blended/%1color=%2alpha=%3" |
40 | .arg("artwork/launcher_arrow_rtl.png") |
41 | @@ -151,6 +158,7 @@ |
42 | problem, but I'm not sure if it should happen in the first place. */ |
43 | anchors.left: (parent) ? parent.left : undefined |
44 | y: item.height - item.tileSize / 2 - height / 2 + getPipOffset(index) |
45 | + mirror: isRightToLeft() |
46 | |
47 | source: "image://blended/%1color=%2alpha=%3" |
48 | .arg(pipSource).arg("lightgrey").arg(1.0) |
49 | |
50 | === modified file 'launcher/app/launcher.cpp' |
51 | --- launcher/app/launcher.cpp 2011-08-09 17:06:35 +0000 |
52 | +++ launcher/app/launcher.cpp 2011-09-20 08:46:25 +0000 |
53 | @@ -90,6 +90,7 @@ |
54 | |
55 | /* Panel containing the QML declarative view */ |
56 | Unity2dPanel panel(true); |
57 | + |
58 | panel.setEdge(Unity2dPanel::LeftEdge); |
59 | panel.setFixedWidth(LauncherClient::MaximumWidth); |
60 | panel.setAccessibleName("Launcher"); |
61 | |
62 | === added file 'libunity-2d-private/Unity2d/launchermenu/arrow_no_transparency_rtl.png' |
63 | Binary files libunity-2d-private/Unity2d/launchermenu/arrow_no_transparency_rtl.png 1970-01-01 00:00:00 +0000 and libunity-2d-private/Unity2d/launchermenu/arrow_no_transparency_rtl.png 2011-09-20 08:46:25 +0000 differ |
64 | === added file 'libunity-2d-private/Unity2d/launchermenu/arrow_rtl.png' |
65 | Binary files libunity-2d-private/Unity2d/launchermenu/arrow_rtl.png 1970-01-01 00:00:00 +0000 and libunity-2d-private/Unity2d/launchermenu/arrow_rtl.png 2011-09-20 08:46:25 +0000 differ |
66 | === added file 'libunity-2d-private/Unity2d/launchermenu/background_no_transparency_rtl.png' |
67 | Binary files libunity-2d-private/Unity2d/launchermenu/background_no_transparency_rtl.png 1970-01-01 00:00:00 +0000 and libunity-2d-private/Unity2d/launchermenu/background_no_transparency_rtl.png 2011-09-20 08:46:25 +0000 differ |
68 | === added file 'libunity-2d-private/Unity2d/launchermenu/background_rtl.png' |
69 | Binary files libunity-2d-private/Unity2d/launchermenu/background_rtl.png 1970-01-01 00:00:00 +0000 and libunity-2d-private/Unity2d/launchermenu/background_rtl.png 2011-09-20 08:46:25 +0000 differ |
70 | === modified file 'libunity-2d-private/Unity2d/launchermenu/launchermenu.qrc' |
71 | --- libunity-2d-private/Unity2d/launchermenu/launchermenu.qrc 2011-06-08 20:43:09 +0000 |
72 | +++ libunity-2d-private/Unity2d/launchermenu/launchermenu.qrc 2011-09-20 08:46:25 +0000 |
73 | @@ -7,5 +7,11 @@ |
74 | <file>check_default.png</file> |
75 | <file>check_selected.png</file> |
76 | <file>launchermenu.css</file> |
77 | + |
78 | + <file>arrow_rtl.png</file> |
79 | + <file>arrow_no_transparency_rtl.png</file> |
80 | + <file>background_rtl.png</file> |
81 | + <file>background_no_transparency_rtl.png</file> |
82 | + <file>launchermenu_rtl.css</file> |
83 | </qresource> |
84 | </RCC> |
85 | |
86 | === added file 'libunity-2d-private/Unity2d/launchermenu/launchermenu_rtl.css' |
87 | --- libunity-2d-private/Unity2d/launchermenu/launchermenu_rtl.css 1970-01-01 00:00:00 +0000 |
88 | +++ libunity-2d-private/Unity2d/launchermenu/launchermenu_rtl.css 2011-09-20 08:46:25 +0000 |
89 | @@ -0,0 +1,82 @@ |
90 | +/* |
91 | + * Copyright (C) 2010 Canonical, Ltd. |
92 | + * |
93 | + * Authors: |
94 | + * Olivier Tilloy <olivier.tilloy@canonical.com> |
95 | + * |
96 | + * This program is free software; you can redistribute it and/or modify |
97 | + * it under the terms of the GNU General Public License as published by |
98 | + * the Free Software Foundation; version 3. |
99 | + * |
100 | + * This program is distributed in the hope that it will be useful, |
101 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
102 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
103 | + * GNU General Public License for more details. |
104 | + * |
105 | + * You should have received a copy of the GNU General Public License |
106 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
107 | + */ |
108 | + |
109 | +QMenu { |
110 | + border-width: 24px 15px 4px 5px; |
111 | + padding-top: -4px; |
112 | + padding-right: -15px; |
113 | + min-width: 72px; |
114 | + min-height: 13px; |
115 | +} |
116 | + |
117 | +QMenu[transparencyAvailable=true] { |
118 | + border-image: url(:/launchermenu/background_rtl.png) 5px 15px 4px 5px Repeat Repeat; |
119 | +} |
120 | + |
121 | +QMenu[transparencyAvailable=false] { |
122 | + border-image: url(:/launchermenu/background_no_transparency_rtl.png) 5px 15px 4px 5px Repeat Repeat; |
123 | +} |
124 | + |
125 | + |
126 | +QMenu::item { |
127 | + color: white; |
128 | + margin-left: 5px; |
129 | + margin-right: 15px; |
130 | + margin-top: 2px; |
131 | + margin-bottom: 2px; |
132 | + padding-left: 25px; |
133 | + padding-right: 25px; |
134 | + padding-top: 5px; |
135 | + padding-bottom: 5px; |
136 | +} |
137 | + |
138 | +QMenu::item:selected:enabled { |
139 | + border-radius: 4px; |
140 | + border-color: rgb(109, 109, 109); |
141 | + border-width: 1px; |
142 | + border-style: solid; |
143 | + color: rgba(41, 41, 41, 90%); |
144 | + background-color: rgba(255, 255, 255, 90%); |
145 | +} |
146 | + |
147 | +QMenu::indicator { |
148 | + width: 16px; |
149 | + height: 13px; |
150 | + margin-right: 3px; |
151 | +} |
152 | + |
153 | +QMenu::indicator:checked { |
154 | + image: url(:/launchermenu/check_default.png); |
155 | +} |
156 | + |
157 | +QMenu::indicator:checked:selected { |
158 | + image: url(:/launchermenu/check_selected.png); |
159 | +} |
160 | + |
161 | +QMenu::separator { |
162 | + height: 1px; |
163 | + margin-left: 4px; |
164 | + margin-right: 14px; |
165 | + background-color: rgba(255, 255, 255, 56%); |
166 | + border-color: rgba(0, 0, 0, 55%); |
167 | + border-style: solid; |
168 | + border-top-width: 1px; |
169 | + border-bottom-width: 1px; |
170 | +} |
171 | + |
172 | |
173 | === modified file 'libunity-2d-private/src/edgehitdetector.cpp' |
174 | --- libunity-2d-private/src/edgehitdetector.cpp 2011-06-11 11:33:52 +0000 |
175 | +++ libunity-2d-private/src/edgehitdetector.cpp 2011-09-20 08:46:25 +0000 |
176 | @@ -51,9 +51,15 @@ |
177 | |
178 | void EdgeHitDetector::updateGeometryFromScreen() |
179 | { |
180 | - int leftScreen = QApplication::desktop()->screenNumber(QPoint()); |
181 | - QRect rect = QApplication::desktop()->screenGeometry(leftScreen); |
182 | - m_mouseArea->setGeometry(rect.left(), rect.top(), 1, rect.height()); |
183 | + QPoint p = QApplication::isLeftToRight() ? |
184 | + QPoint() : |
185 | + QPoint(QApplication::desktop()->width() - 1, 0); |
186 | + QRect rect = QApplication::desktop()->screenGeometry(p); |
187 | + if (QApplication::isLeftToRight()) { |
188 | + m_mouseArea->setGeometry(rect.left(), rect.top(), 1, rect.height()); |
189 | + } else { |
190 | + m_mouseArea->setGeometry(rect.right() - 1, rect.top(), 1, rect.height()); |
191 | + } |
192 | } |
193 | |
194 | #include "edgehitdetector.moc" |
195 | |
196 | === modified file 'libunity-2d-private/src/intellihidebehavior.cpp' |
197 | --- libunity-2d-private/src/intellihidebehavior.cpp 2011-06-27 13:43:05 +0000 |
198 | +++ libunity-2d-private/src/intellihidebehavior.cpp 2011-09-20 08:46:25 +0000 |
199 | @@ -13,6 +13,7 @@ |
200 | #include "intellihidebehavior.h" |
201 | |
202 | // Local |
203 | +#include "unity2dpanel.h" |
204 | |
205 | // libunity-2d |
206 | #include <debug_p.h> |
207 | @@ -23,6 +24,7 @@ |
208 | #include <QEvent> |
209 | #include <QTimer> |
210 | #include <QWidget> |
211 | +#include <QDesktopWidget> |
212 | |
213 | // libwnck |
214 | extern "C" { |
215 | @@ -131,7 +133,15 @@ |
216 | // Compute launcherRect, adjust "left" to the position where the launcher |
217 | // is fully visible. |
218 | QRect launcherRect = m_panel->geometry(); |
219 | - launcherRect.moveLeft(0); |
220 | + // FIXME: the following code assumes that the launcher is on the left edge |
221 | + // of the screen |
222 | + if (QApplication::isLeftToRight()) { |
223 | + launcherRect.moveLeft(0); |
224 | + } else { |
225 | + QDesktopWidget* desktop = QApplication::desktop(); |
226 | + const QRect screen = desktop->screenGeometry(m_panel); |
227 | + launcherRect.moveRight(screen.right()); |
228 | + } |
229 | |
230 | WnckScreen* screen = wnck_screen_get_default(); |
231 | WnckWorkspace* workspace = wnck_screen_get_active_workspace(screen); |
232 | |
233 | === modified file 'libunity-2d-private/src/launchermenu.cpp' |
234 | --- libunity-2d-private/src/launchermenu.cpp 2011-08-01 13:04:32 +0000 |
235 | +++ libunity-2d-private/src/launchermenu.cpp 2011-09-20 08:46:25 +0000 |
236 | @@ -58,9 +58,17 @@ |
237 | /* Load the pixmap for the arrow. It is drawn separately as its position |
238 | may vary depending on the position of the menu on the screen. */ |
239 | if (transparencyAvailable()) { |
240 | - m_arrow.load(":/launchermenu/arrow.png"); |
241 | + if (QApplication::isLeftToRight()) { |
242 | + m_arrow.load(":/launchermenu/arrow.png"); |
243 | + } else { |
244 | + m_arrow.load(":/launchermenu/arrow_rtl.png"); |
245 | + } |
246 | } else { |
247 | - m_arrow.load(":/launchermenu/arrow_no_transparency.png"); |
248 | + if (QApplication::isLeftToRight()) { |
249 | + m_arrow.load(":/launchermenu/arrow_no_transparency.png"); |
250 | + } else { |
251 | + m_arrow.load(":/launchermenu/arrow_no_transparency_rtl.png"); |
252 | + } |
253 | } |
254 | |
255 | /* First action used to display the title of the item */ |
256 | @@ -77,6 +85,9 @@ |
257 | LauncherContextualMenu::loadCSS() |
258 | { |
259 | QString cssFilePath = ":/launchermenu/launchermenu.css"; |
260 | + if (QApplication::isRightToLeft()) { |
261 | + cssFilePath = ":/launchermenu/launchermenu_rtl.css"; |
262 | + } |
263 | |
264 | QFile file(cssFilePath); |
265 | if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) |
266 | @@ -154,6 +165,11 @@ |
267 | return; |
268 | |
269 | m_arrowY = 6; |
270 | + |
271 | + if (QApplication::isRightToLeft()) { |
272 | + x = QApplication::desktop()->width() - x - sizeHint().width(); |
273 | + } |
274 | + |
275 | move(x, y - minimumSize().height() / 2); |
276 | QMenu::show(); |
277 | |
278 | @@ -203,10 +219,15 @@ |
279 | } |
280 | } |
281 | } else { |
282 | + int prevWidth = width(); |
283 | + int left = x(), top = y(); |
284 | addSeparator(); |
285 | m_launcherItem->createMenuActions(); |
286 | |
287 | QRect screenGeometry = QApplication::desktop()->screenGeometry(this); |
288 | + if (QApplication::isRightToLeft()) { |
289 | + left -= width() - prevWidth; |
290 | + } |
291 | if (height() <= screenGeometry.height()) { |
292 | /* Adjust the position of the menu only if it fits entirely on the screen. */ |
293 | int menuBottomEdge = y() + height(); |
294 | @@ -214,13 +235,14 @@ |
295 | if (menuBottomEdge > screenBottomEdge) { |
296 | /* The menu goes offscreen, shift it upwards. */ |
297 | m_arrowY += menuBottomEdge - screenBottomEdge; |
298 | - move(x(), screenBottomEdge - height()); |
299 | - if (!transparencyAvailable()) { |
300 | - /* The arrow has moved relatively to the menu. */ |
301 | - updateMask(); |
302 | - } |
303 | + top = screenBottomEdge - height(); |
304 | } |
305 | } |
306 | + move(left, top); |
307 | + if (!transparencyAvailable()) { |
308 | + /* The arrow has moved relatively to the menu. */ |
309 | + updateMask(); |
310 | + } |
311 | } |
312 | |
313 | m_folded = folded; |
314 | @@ -236,7 +258,11 @@ |
315 | /* Draw the arrow. */ |
316 | QPainter painter(this); |
317 | painter.setCompositionMode(QPainter::CompositionMode_Source); |
318 | - painter.drawPixmap(0, m_arrowY, m_arrow); |
319 | + int left = 0; |
320 | + if (QApplication::isRightToLeft()) { |
321 | + left = width() - m_arrow.width(); |
322 | + } |
323 | + painter.drawPixmap(left, m_arrowY, m_arrow); |
324 | } |
325 | |
326 | LauncherItem* |
327 | |
328 | === modified file 'libunity-2d-private/src/unity2dapplication.cpp' |
329 | --- libunity-2d-private/src/unity2dapplication.cpp 2011-07-27 19:25:45 +0000 |
330 | +++ libunity-2d-private/src/unity2dapplication.cpp 2011-09-20 08:46:25 +0000 |
331 | @@ -28,6 +28,7 @@ |
332 | #include <gconnector.h> |
333 | #include <gscopedpointer.h> |
334 | #include <unity2ddebug.h> |
335 | +#include <unity2dtr.h> |
336 | |
337 | // Qt |
338 | #include <QFont> |
339 | @@ -145,6 +146,12 @@ |
340 | : QApplication(argc, argv) |
341 | , m_platformFontTracker(new PlatformFontTracker) |
342 | { |
343 | + /* Configure translations */ |
344 | + Unity2dTr::init("unity-2d", INSTALL_PREFIX "/share/locale"); |
345 | + if (u2dTr("QT_LAYOUT_DIRECTION") == "RTL") { |
346 | + QApplication::setLayoutDirection(Qt::RightToLeft); |
347 | + } |
348 | + |
349 | /* Allow developers to run Unity 2D uninstalled by telling dconf-qt |
350 | where to look for Unity 2D's schemas. |
351 | It relies on the fact that the schema is compiled when running cmake. |
352 | |
353 | === modified file 'libunity-2d-private/src/unity2dpanel.cpp' |
354 | --- libunity-2d-private/src/unity2dpanel.cpp 2011-08-22 10:38:32 +0000 |
355 | +++ libunity-2d-private/src/unity2dpanel.cpp 2011-09-20 08:46:25 +0000 |
356 | @@ -67,9 +67,15 @@ |
357 | ulong struts[12] = {}; |
358 | switch (m_edge) { |
359 | case Unity2dPanel::LeftEdge: |
360 | - struts[0] = q->width(); |
361 | - struts[4] = available.top(); |
362 | - struts[5] = available.y() + available.height(); |
363 | + if (QApplication::isLeftToRight()) { |
364 | + struts[0] = q->width(); |
365 | + struts[4] = available.top(); |
366 | + struts[5] = available.y() + available.height(); |
367 | + } else { |
368 | + struts[1] = q->width(); |
369 | + struts[6] = available.top(); |
370 | + struts[7] = available.y() + available.height(); |
371 | + } |
372 | break; |
373 | case Unity2dPanel::TopEdge: |
374 | struts[2] = q->height(); |
375 | @@ -97,8 +103,13 @@ |
376 | QRect rect; |
377 | switch (m_edge) { |
378 | case Unity2dPanel::LeftEdge: |
379 | - rect = QRect(screen.left(), available.top(), q->width(), available.height()); |
380 | - rect.moveLeft(m_delta); |
381 | + if (QApplication::isLeftToRight()) { |
382 | + rect = QRect(screen.left(), available.top(), q->width(), available.height()); |
383 | + rect.moveLeft(m_delta); |
384 | + } else { |
385 | + rect = QRect(screen.right() - q->width(), available.top(), q->width(), available.height()); |
386 | + rect.moveRight(screen.right() - m_delta); |
387 | + } |
388 | break; |
389 | case Unity2dPanel::TopEdge: |
390 | rect = QRect(screen.left(), screen.top(), screen.width(), q->height()); |
391 | @@ -114,7 +125,7 @@ |
392 | QBoxLayout::Direction direction; |
393 | switch(m_edge) { |
394 | case Unity2dPanel::TopEdge: |
395 | - direction = QApplication::isRightToLeft() ? QBoxLayout::RightToLeft : QBoxLayout::LeftToRight; |
396 | + direction = QBoxLayout::LeftToRight; |
397 | break; |
398 | case Unity2dPanel::LeftEdge: |
399 | direction = QBoxLayout::TopToBottom; |
400 | |
401 | === modified file 'panel/app/main.cpp' |
402 | --- panel/app/main.cpp 2011-07-27 19:25:45 +0000 |
403 | +++ panel/app/main.cpp 2011-09-20 08:46:25 +0000 |
404 | @@ -28,7 +28,6 @@ |
405 | #include <gnomesessionclient.h> |
406 | #include <unity2ddebug.h> |
407 | #include <unity2dapplication.h> |
408 | -#include <unity2dtr.h> |
409 | |
410 | // Qt |
411 | #include <QAbstractFileEngineHandler> |
412 | @@ -62,9 +61,6 @@ |
413 | GnomeSessionClient client(INSTALL_PREFIX "/share/applications/unity-2d-panel.desktop"); |
414 | client.connectToSessionManager(); |
415 | |
416 | - /* Configure translations */ |
417 | - Unity2dTr::init("unity-2d", INSTALL_PREFIX "/share/locale"); |
418 | - |
419 | PanelManager panels; |
420 | |
421 | return app.exec(); |
422 | |
423 | === modified file 'panel/app/panelmanager.cpp' |
424 | --- panel/app/panelmanager.cpp 2011-08-30 10:41:50 +0000 |
425 | +++ panel/app/panelmanager.cpp 2011-09-20 08:46:25 +0000 |
426 | @@ -138,7 +138,11 @@ |
427 | panel->setEdge(Unity2dPanel::TopEdge); |
428 | panel->setFixedHeight(24); |
429 | |
430 | - int leftmost = QApplication::desktop()->screenNumber(QPoint()); |
431 | + QPoint p; |
432 | + if (QApplication::isRightToLeft()) { |
433 | + p = QPoint(QApplication::desktop()->width() - 1, 0); |
434 | + } |
435 | + int leftmost = QApplication::desktop()->screenNumber(p); |
436 | |
437 | QHash<QString, PanelAppletProviderInterface*> plugins = loadPlugins(); |
438 | |
439 | |
440 | === modified file 'panel/applets/appname/appnameapplet.cpp' |
441 | --- panel/applets/appname/appnameapplet.cpp 2011-09-05 13:56:16 +0000 |
442 | +++ panel/applets/appname/appnameapplet.cpp 2011-09-20 08:46:25 +0000 |
443 | @@ -132,7 +132,11 @@ |
444 | m_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); |
445 | m_label->setTextFormat(Qt::PlainText); |
446 | // Align left of label with left of menubar |
447 | - m_label->setContentsMargins(APPNAME_LABEL_LEFT_MARGIN, 0, 0, 0); |
448 | + if (QApplication::isLeftToRight()) { |
449 | + m_label->setContentsMargins(APPNAME_LABEL_LEFT_MARGIN, 0, 0, 0); |
450 | + } else { |
451 | + m_label->setContentsMargins(0, 0, APPNAME_LABEL_LEFT_MARGIN, 0); |
452 | + } |
453 | QFont font = m_label->font(); |
454 | font.setBold(true); |
455 | m_label->setFont(font); |
456 | |
457 | === modified file 'panel/applets/appname/croppedlabel.cpp' |
458 | --- panel/applets/appname/croppedlabel.cpp 2011-09-15 08:33:23 +0000 |
459 | +++ panel/applets/appname/croppedlabel.cpp 2011-09-20 08:46:25 +0000 |
460 | @@ -32,6 +32,7 @@ |
461 | #include <gconfitem-qml-wrapper.h> |
462 | |
463 | // Qt |
464 | +#include <QApplication> |
465 | #include <QImage> |
466 | #include <QPainter> |
467 | |
468 | @@ -61,10 +62,12 @@ |
469 | { |
470 | QPainter painter(image); |
471 | painter.setCompositionMode(QPainter::CompositionMode_DestinationIn); |
472 | - QRect gradientRect(image->width() - FADEOUT_WIDTH, 0, FADEOUT_WIDTH, image->height()); |
473 | + bool isLeftToRight = QApplication::isLeftToRight(); |
474 | + QRect gradientRect(isLeftToRight ? image->width() - FADEOUT_WIDTH : 0, 0, |
475 | + FADEOUT_WIDTH, image->height()); |
476 | QLinearGradient gradient(gradientRect.topLeft(), gradientRect.topRight()); |
477 | - gradient.setColorAt(0, Qt::white); |
478 | - gradient.setColorAt(1, Qt::transparent); |
479 | + gradient.setColorAt(0, isLeftToRight ? Qt::white : Qt::transparent); |
480 | + gradient.setColorAt(1, isLeftToRight ? Qt::transparent : Qt::white); |
481 | painter.fillRect(gradientRect, gradient); |
482 | } |
483 | |
484 | @@ -117,7 +120,9 @@ |
485 | gtk_style_context_add_class(style_context, GTK_STYLE_CLASS_MENUITEM); |
486 | |
487 | gtk_render_layout(style_context, cr.data(), |
488 | - contentsRect().left(), |
489 | + QApplication::isLeftToRight() ? |
490 | + contentsRect().left() : |
491 | + contentsRect().right() - textWidth, |
492 | contentsRect().top() + (height() - textHeight) / 2, |
493 | layout.data()); |
494 | |
495 | |
496 | === modified file 'places/SearchEntry.qml' |
497 | --- places/SearchEntry.qml 2011-09-13 18:14:44 +0000 |
498 | +++ places/SearchEntry.qml 2011-09-20 08:46:25 +0000 |
499 | @@ -103,6 +103,7 @@ |
500 | anchors.leftMargin: -5 |
501 | anchors.right: parent.right |
502 | anchors.verticalCenter: parent.verticalCenter |
503 | + horizontalAlignment: Text.AlignLeft |
504 | |
505 | color: "#ffffff" |
506 | font.pixelSize: 28 |
507 | @@ -159,6 +160,8 @@ |
508 | anchors.left: parent.left |
509 | anchors.right: parent.right |
510 | anchors.verticalCenter: parent.verticalCenter |
511 | + LayoutMirroring.enabled: false |
512 | + horizontalAlignment: isRightToLeft() ? Text.AlignRight : Text.AlignLeft |
513 | |
514 | color: "white" |
515 | opacity: 0.5 |
516 | |
517 | === modified file 'places/app/dashdeclarativeview.cpp' |
518 | --- places/app/dashdeclarativeview.cpp 2011-09-15 16:36:17 +0000 |
519 | +++ places/app/dashdeclarativeview.cpp 2011-09-20 08:46:25 +0000 |
520 | @@ -119,11 +119,16 @@ |
521 | DashDeclarativeView::resizeToDesktopModeSize() |
522 | { |
523 | QRect rect = availableGeometry(); |
524 | + int screenRight = rect.right(); |
525 | |
526 | rect.setWidth(qMin(DASH_DESKTOP_WIDTH, rect.width())); |
527 | rect.setHeight(qMin(m_expanded ? DASH_DESKTOP_EXPANDED_HEIGHT : DASH_DESKTOP_COLLAPSED_HEIGHT, |
528 | rect.height())); |
529 | |
530 | + if (QApplication::isRightToLeft()) { |
531 | + rect.moveRight(screenRight); |
532 | + } |
533 | + |
534 | move(rect.topLeft()); |
535 | setFixedSize(rect.size()); |
536 | } |
537 | @@ -267,12 +272,16 @@ |
538 | QRect screenRect = QApplication::desktop()->screenGeometry(this); |
539 | QRect availableRect = QApplication::desktop()->availableGeometry(this); |
540 | |
541 | - return QRect( |
542 | + QRect availableGeometry( |
543 | LauncherClient::MaximumWidth, |
544 | availableRect.top(), |
545 | screenRect.width() - LauncherClient::MaximumWidth, |
546 | availableRect.height() |
547 | ); |
548 | + if (QApplication::isRightToLeft()) { |
549 | + availableGeometry.moveLeft(0); |
550 | + } |
551 | + return availableGeometry; |
552 | } |
553 | |
554 | void |
555 | |
556 | === modified file 'places/dash.qml' |
557 | --- places/dash.qml 2011-09-16 13:07:35 +0000 |
558 | +++ places/dash.qml 2011-09-20 08:46:25 +0000 |
559 | @@ -16,7 +16,7 @@ |
560 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
561 | */ |
562 | |
563 | -import QtQuick 1.0 |
564 | +import QtQuick 1.1 |
565 | import Unity2d 1.0 |
566 | import Effects 1.0 |
567 | |
568 | @@ -24,9 +24,15 @@ |
569 | id: dash |
570 | |
571 | Accessible.name: "root" |
572 | + LayoutMirroring.enabled: isRightToLeft() |
573 | + LayoutMirroring.childrenInherit: true |
574 | |
575 | property variant currentPage |
576 | |
577 | + function isRightToLeft() { |
578 | + return Qt.application.layoutDirection == Qt.RightToLeft |
579 | + } |
580 | + |
581 | Binding { |
582 | target: dashView |
583 | property: "expanded" |
584 | @@ -180,6 +186,7 @@ |
585 | anchors.fill: parent |
586 | visible: dashView.dashMode == DashDeclarativeView.DesktopMode |
587 | source: screen.isCompositingManagerRunning ? "artwork/desktop_dash_background.sci" : "artwork/desktop_dash_background_no_transparency.sci" |
588 | + mirror: isRightToLeft() |
589 | } |
590 | } |
591 | |
592 | @@ -289,6 +296,7 @@ |
593 | Image { |
594 | id: fullScreenButtonImage |
595 | source: "artwork/fullscreen_button.png" |
596 | + mirror: isRightToLeft() |
597 | } |
598 | |
599 | onClicked: { |
I see lots of warnings on the console. For example when starting the dash:
unity-2d-places: [WARNING] QDeclarativeExp ression: Expression "(function $leftMargin() { return leftRight(-5,0) })" depends on non-NOTIFYable properties: View::layoutDir ection ression: Expression "(function $rightMargin() { return rightLeft(-5,0) })" depends on non-NOTIFYable properties: View::layoutDir ection ression: Expression "(function $right() { return rightLeft( parent. right) })" depends on non-NOTIFYable properties: View::layoutDir ection ression: Expression "(function $left() { return leftRight( parent. left) })" depends on non-NOTIFYable properties:
unity-2d-places: [WARNING] DashDeclarative
unity-2d-places: [WARNING] QDeclarativeExp
unity-2d-places: [WARNING] DashDeclarative
unity-2d-places: [WARNING] QDeclarativeExp
unity-2d-places: [WARNING] DashDeclarative
unity-2d-places: [WARNING] QDeclarativeExp