Bug 92090

Summary: support for "always LTR" toolbar items on RTL/BIDI desktops
Product: [Unmaintained] kdelibs Reporter: Diego Iastrubni <cuco3001>
Component: generalAssignee: Stephan Kulow <coolo>
Status: RESOLVED FIXED    
Severity: major CC: grundleborg, rodda, tyrerj
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Diego Iastrubni 2004-10-25 21:26:48 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

QT reverses the order of itmes in QToolBars in RTL desktops by default. (well when you set QApplication::reverseLayout()).

This beheaviour is correct about 99.7% of the time. However, sometimes you need a few items to be on the same order ("A" to the right of "B") always, even in RTL desktops.

A few examples:
1) kword:
run "kword --reverse" you will see that the items for alligning text to the right/left are versed. 

2) amarok and other media players:
the play button and the scroll bar, should always be in the same order (even on RTL desktops). I hacked a few of them by adding a new file for the toolbars, but this is not a good solution. (see juk for example).

My proposal:
make a new attribute to the the dom node of the "rc" files, something like "always-ltr=1", which will reverse the elements of the node before inserting them to the QTollBar if QApplication::reverseLayout() is true.
This way, the elements will be reverserd twise (once  by QLayout and second time by this engine), and will be displayed as in LTR desktopns even on reversed layouts.
Comment 1 James Richard Tyrer 2007-06-28 01:51:11 UTC
First, I think that this is a major bug, not a wishlist, since it affects a lot of applications.

The simplest solution is to have (when needed) a separate "*.rc" file for RTL.

Unfortunately, this will not fix the problem for apps that don't yet control the toolbars buttons with an *.rc file.
Comment 2 Thomas Zander 2007-06-28 12:49:18 UTC
SVN commit 681256 by zander:

Fix the odd usecase when we start in RTL mode which swaps the ordering of the
buttons and thus makes the align-left and align-right ones be weirdly ordered.
This fixes it so align-left is always to the left of align-right for KOffice.

CCBUG: 92090


 M  +11 -2     SimpleStyleWidget.cpp  


--- trunk/koffice/shapes/text/dialogs/SimpleStyleWidget.cpp #681255:681256
@@ -35,8 +35,17 @@
     widget.italic->setDefaultAction(tool->action("format_italic"));
     widget.strikeOut->setDefaultAction(tool->action("format_strike"));
     widget.underline->setDefaultAction(tool->action("format_underline"));
-    widget.alignLeft->setDefaultAction(tool->action("format_alignleft"));
-    widget.alignRight->setDefaultAction(tool->action("format_alignright"));
+    // RTL layout will reverse the button order, but the align left/right then get mixed up.
+    // this makes sure that whatever happens the 'align left' is to the left of the 'align right'
+    if(QApplication::isRightToLeft()) {
+        widget.alignLeft->setDefaultAction(tool->action("format_alignright"));
+        widget.alignRight->setDefaultAction(tool->action("format_alignleft"));
+    }
+    else {
+        widget.alignLeft->setDefaultAction(tool->action("format_alignleft"));
+        widget.alignRight->setDefaultAction(tool->action("format_alignright"));
+    }
+
     widget.alignCenter->setDefaultAction(tool->action("format_aligncenter"));
     widget.alignBlock->setDefaultAction(tool->action("format_alignblock"));
     widget.superscript->setDefaultAction(tool->action("format_super"));
Comment 3 George Goldberg 2008-08-04 22:35:00 UTC
SVN commit 842180 by gberg:

Fix the back/play/stop/forward buttons to display in the same order even when amarok is run in right-to-left mode.

CCBUG:92090

 M  +16 -4     MainToolbar.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=842180
Comment 4 George Goldberg 2008-08-05 18:28:27 UTC
This bug is now fixed in juk, kword and amarok. The solution as mentioned in comment #1 is used where applications use .rc files. Since there are no more examples given where the bug still exists, I am going to close it. Please reopen if there are places in KDE where this bug is still present.