KDE/kdelibs

Diego Iastrubni <[email protected]>
Newsgroups gmane.comp.kde.internationalization.hebrew
Message-ID <[email protected]>
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: [email protected]



 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  


--- trunk/KDE/kdelibs/kdeui/widgets/klineedit.cpp #846872:846873
@@ -290,7 +290,7 @@
         return;
     }
 
-    if (qApp->isLeftToRight()) {
+    if (layoutDirection() == Qt::RightToLeft) {
         d->clearButton->setPixmap(SmallIcon("edit-clear-locationbar-rtl", 0, clearButtonState));
     } else {
         d->clearButton->setPixmap(SmallIcon("edit-clear-locationbar-ltr", 0, clearButtonState));
@@ -321,7 +321,7 @@
         d->overlap = wideEnough ? buttonWidth + frameWidth : 0;
     }
 
-    if (qApp->isLeftToRight()) {
+    if (layoutDirection() == Qt::LeftToRight ) {
         d->clearButton->move(geom.width() - frameWidth - buttonWidth - 1, 0);
     } else {
         d->clearButton->move(frameWidth + 1, 0);
--- trunk/KDE/kdelibs/kfile/kdiroperator.cpp #846872:846873
@@ -341,6 +341,10 @@
         d->currUrl.addPath("/"); // make sure we have a trailing slash!
     }
 
+    // We set the direction of this widget to LTR, since even on RTL desktops
+    // viewing directory listings in RTL mode makes people's head explode.
+    // Is this the correct place? Maybe it should be in some lower level widgets...?
+    setLayoutDirection(Qt::LeftToRight);
     setDirLister(new KDirLister());
 
     connect(&d->completion, SIGNAL(match(const QString&)),
--- trunk/KDE/kdelibs/kfile/kurlnavigator.cpp #846872:846873
@@ -418,6 +418,7 @@
     
     QString spacer;
     KMenu* popup = new KMenu(q); 
+    popup->setLayoutDirection(Qt::LeftToRight);
     
     const QString path = q->url().pathOrUrl();
     QString placePath = retrievePlacePath(path);
@@ -750,6 +751,7 @@
     d(new Private(this, placesModel))
 {
     d->m_history.prepend(HistoryElem(url));
+    setLayoutDirection(Qt::LeftToRight);
 
     const QFont font = KGlobalSettings::generalFont();
     setFont(font);
--- trunk/KDE/kdelibs/kfile/kurlnavigatorbutton.cpp #846872:846873
@@ -373,6 +373,7 @@
     update(); // ensure the button is drawn highlighted
 
     KMenu* dirsMenu = new KMenu(this);
+    dirsMenu->setLayoutDirection(Qt::LeftToRight);
     QStringList::const_iterator it = m_subdirs.constBegin();
     QStringList::const_iterator itEnd = m_subdirs.constEnd();
     int i = 0;
--- trunk/KDE/kdelibs/kio/kfile/kurlcombobox.cpp #846872:846873
@@ -76,6 +76,7 @@
     : KComboBox( parent),d(new KUrlComboBoxPrivate(this))
 {
     d->init( mode );
+    setLayoutDirection( Qt::LeftToRight );
 }
 
 
--- trunk/KDE/kdelibs/kio/kfile/kurlcombobox.h #846872:846873
@@ -35,6 +35,11 @@
  * It will manage the default dirs root-directory, home-directory and
  * Desktop-directory, as well as a number of URLs set via setUrls()
  * and one additional entry to be set via setUrl().
+ * 
+ * This widget forces the layout direction to be Qt::LeftToRight instead
+ * of inheriting the layout direction like a normal widget. This means
+ * that even in RTL desktops the widget will be displayed in LTR mode,
+ * as generally URLs are LTR by nature.
  *
  * @short A combo box showing a number of recent URLs/directories
  * @author Carsten Pfeiffer <[email protected]>

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/kde-il/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/kde-il/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.