Bug 168725

Summary: The titlebar should be LTR always
Product: [Applications] dolphin Reporter: Zayed Al-Saidi <zayed.alsaidi>
Component: generalAssignee: Diego Iastrubni <elcuco>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 16.12.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: locationbar in RTL
My proposed fix - screen shot
My proposed fix - patch

Description Zayed Al-Saidi 2008-08-08 11:44:24 UTC
Version:            (using KDE 4.1.0)
Installed from:    Ubuntu Packages

The titlebar in dolphin and Konqueror should be LTR always even in RTL language like Arabic. That because the root directories are in English. In Konqueror, all the website addresses are in English.
Comment 1 Peter Penz 2008-08-08 11:50:42 UTC
Thanks for the report. Do you mean the "location bar" of Dolphin and Konqueror (= where the URL is entered) or do you really mean the "title bar" (= window title)? Although I've some experience with RTL languages like Arabic, I'm not sure here what you mean. Would it be possible that you send a screenshot how it is rendered currently and one faked screenshot how you want to have it? That would be great :-)
Comment 2 Zayed Al-Saidi 2008-08-08 12:25:32 UTC
I am sorry. I mean location bar not titlebar. I try to get some screenshot for what I mean and what I want. 
Comment 3 Zayed Al-Saidi 2008-08-08 12:26:36 UTC
Created attachment 26732 [details]
locationbar in RTL
Comment 4 Peter Penz 2008-08-08 13:10:18 UTC
Thanks for the screenshot, now it is clear for me what you want. One last question: If you switch back the location bar to the "breadcrumb view" by pressing the yellow arrow on the right, then currently the layout of the breadcrumbs is done this way in Arabic:

                       [zayed] < [home]

Is this alignment correct or should this also be changed to:

[home] > [zayed]

? My guess is that the current way ([zayed] < [home]) should be kept. Is this correct?
Comment 5 Zayed Al-Saidi 2008-08-08 14:09:46 UTC
Regarding breadcrumb view, yes, the current way should be kept.
By the way, do I need report another bug for Konqueror, open-dialog and save-dialog with the seem issue ?
Comment 6 Peter Penz 2008-08-08 14:12:11 UTC
> By the way, do I need report another bug for Konqueror,
> open-dialog and save-dialog with the seem issue ?

For Konqueror it would be great if you could submit a separate bug-report - you can refer to this report as reference. For the open-dialog and save-dialog no report is needed, as both use the same widget as Dolphin :-) Thanks!
Comment 7 Diego Iastrubni 2008-08-12 21:47:54 UTC
Ahalan Zayed, I totally agree. (BTW, saw your other bugs, don't worry, I will get them in the end...)

Peter,
KDirOperator (the display of the directory) and KUrlNavigator (the breadcrumb) should be LTR. 

A simple workaround: 
inside KDirOperator's constructor, put setLayoutDirection( Qt::LeftToRight ). However, that messes up things a little since the file preview is in the middle of the dialog (and not the left side).

For KUrlNavigator, the same hack works pretty good, besides the fact that also the popups for each dir should be LTR as well. I will commit this to the svn/trunk in the next few minutes (I need to test a little more). 
Comment 8 Diego Iastrubni 2008-08-12 22:30:19 UTC
That was not that hard... :)

This patch fixes KUrlNavigator and KUrlButtonNavigator. I am also attaching an image which shows how it looks here. Is it Ok to commit to trunk? 

Can you backport to branch? (I can do this blindly assuming "it will be ok", but I am not happy about it).

TODO:
1) The dolphin view is still RTL
2) KdirOperator is still RTL

Both of this issues should be assigned in another bug. Zayed if you open a new bug report for them - you can assign them to me.
Comment 9 Diego Iastrubni 2008-08-12 22:32:01 UTC
Created attachment 26812 [details]
My proposed fix - screen shot

This is how it looks on my setup
Comment 10 Diego Iastrubni 2008-08-12 22:32:45 UTC
Created attachment 26813 [details]
My proposed fix - patch

My proposed fix - the patch
Comment 11 Zayed Al-Saidi 2008-08-13 14:04:57 UTC
أهلا Diego :)

Regarding the breadcrumbs, I prefer to be RTL (i.e. what we have now in KDE 4.1) like this  :

                       [zayed] < [home] 

Because we do not have any problem with it :) . In case of of location bar, we do have problem which it is difficult to write Latin letter in RTL mode. But in breadcrumbs you can select the folder by mouse from right to left without any problem even if the name is in Latin letter. 
Comment 12 Diego Iastrubni 2008-08-13 23:31:38 UTC
I have a patch against half of kdelibs which forces the breadcrumbs to be LTR. IMHO, the dir names are LTR - and thus the whole widget should be LTR. Otherwise, when moving from one mode to another, the text location will change (remember that more or less the breadcrumb text should match the text in the KUrlComboBox.

This will also affect file names which end with "_". 

I am holding my commit (I found a few interesting errors in KLineEdit*, that was fun...). I will give you some time to understand that I am right (oviously) and then commit ;-)

For KDE 4.2 the URL bar, and the icons view will look the same in LTR and RTL desktops. Sorry, but using KDE3 for 5 years teaches me that file browsing is an LTR always mission.

Peter, I am re-assigning this bug to me, so I remember about this issue. One bug less for you ;-)
Comment 13 Zayed Al-Saidi 2008-08-14 05:17:53 UTC
Ok, if there is no choose, the suggested solution better than what we have in KDE 4.1 !
Comment 14 Peter Penz 2008-08-14 07:49:08 UTC
@Diego:
> Peter, I am re-assigning this bug to me, so I remember
> about this issue. One bug less for you ;-) 

Great, thanks :-) PS: minor nitpicking: could you please remove the spaces inside the brackets to be consistent with the kdelibs style? What I mean is instead of:
  setLayoutDirection( Qt::LeftToRight );
please use
  setLayoutDirection(Qt::LeftToRight);
Thanks!

@Zayed:
> Ok, if there is no choose, the suggested solution better
> than what we have in KDE 4.1 ! 

I must leave the final decision to you and Diego on this topic - I really don't know what feels more familiar...
Comment 15 Diego Iastrubni 2008-08-14 11:28:59 UTC
SVN commit 846873 by iastrubni:

Force KUrlComboBox to be LTR even in RTL desktops, as URL are always in latin chars (I know about international domain names, but I 
ignore them for the moment).

BUG: 168725
CCMAIL: kde-il@yahoogroups.com



 M  +2 -2      kdeui/widgets/klineedit.cpp  
 M  +4 -0      kfile/kdiroperator.cpp  
 M  +2 -0      kfile/kurlnavigator.cpp  
 M  +1 -0      kfile/kurlnavigatorbutton.cpp  
 M  +1 -0      kio/kfile/kurlcombobox.cpp  
 M  +5 -0      kio/kfile/kurlcombobox.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=846873