[RFC] LTR vs. RTL (Direction Arrows revisited)

James Richard Tyrer tyrerj at acm.org
Thu Jun 28 02:08:42 BST 2007


Having discussed this, looked at a user's screen shots, and done some
research, I think that I now understand the issue.

When instructed to do so by setting: QApplication::isRightToLeft() to
TRUE, Qt starts the toolbar on the right end and reverses the order of
the buttons.  In most cases this fixes the issue.

In some cases (e.g. FindNext) the function isn't really what it is
called -- find next actually is FindForward -- so it has the opposite
effect in RTL so we reverse the icons so that they look correct --
FindForward now points the other way and although the function is still
the same, it does the correct thing which is: FindPrevious.

Double reversal gets it correct[?!] -- no wonder I was a bit confused. :-)

But, in some cases the reversal by Qt doesn't fix the problem --
actually causes a problem.  The issue then is what to do when this
double reversal doesn't work.

The first example from Bug 92090 is the alignment of text.  These are
AlignRight & AlignLeft.  Since these still have the same functions in
RTL, the double reversal isn't needed.  The icons aren't reversed, but
the order of the buttons is.  Reversing the order isn't correct; we now
have AlignLeft on the Right and AlignRight on the Left.

Contrary to what was said elsewhere, there is a general solution to this
issue -- this solution that will only work with applications which use
an XML "*.rc" file to configure the toolbars but these applications need
to convert to this anyhow.

I think that the simplest solution would be to have optional RTL "*.rc"
files (e.g. "<app_name>.rtl.rc").  Since these files are retrieved
indirectly, the code would only need to be changed in one place to look
for the "*.rtl.rc" file if QApplication::isRightToLeft() was TRUE and
use it if it existed, otherwise to read the: "*.rtl" file but write back
to "*.rtl.rc" in all cases when QApplication::isRightToLeft() was TRUE.

The other possibility would be to add this to the XML files ("*.rc") so
that they could contain additional information.  That is it could also
contain: <toolbar_rtl> </toolbar_rtl>.  Again, since the files are
parsed indirectly, only one part of the code would need to be changed.

In either cases, "*.rc" files need to be modified for RTL.

-- 
JRT



 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<




More information about the kde-core-devel mailing list