Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > a6bc312ce50b5c8d0c51736e58ac32bc > files > 263

kdebase-3.4.2-55mdk.src.rpm

--- kdebase-3.2.2/kicker/core/container_panel.cpp.fix_kicker_rtl	2004-04-23 10:13:47.910246764 +0200
+++ kdebase-3.2.2/kicker/core/container_panel.cpp	2004-04-23 10:15:00.298134668 +0200
@@ -183,9 +183,26 @@ PanelContainer::PanelContainer(QWidget *
     connect( _popupWidgetFilter, SIGNAL(popupWidgetHiding()), SLOT(maybeStartAutoHideTimer()) );
 
     // layout
-    _layout = new QBoxLayout( this, orientation() == Horizontal ? QBoxLayout::LeftToRight
-			      : QBoxLayout::TopToBottom, 0, 0);
-    _layout->setResizeMode( QLayout::FreeResize );
+    
+    /* This is actually a work arround some miss implementations in QT
+        in the constructor, we passed the direction, however QT is "smart"
+       enough to reverse it in RTL desktops. We need this widget to be "LTR"
+       always. (remeber that we are in reverseLayout).
+       
+       QT4 will have a special API to tell a layout "you shall be always LTR". Now,
+       we hack it.
+    */
+    
+    QBoxLayout::Direction dir;
+    
+    if (QApplication::reverseLayout())
+       dir = orientation() == Horizontal ? QBoxLayout::RightToLeft  : QBoxLayout::TopToBottom;
+    else
+       dir = orientation() == Horizontal ? QBoxLayout::LeftToRight  : QBoxLayout::TopToBottom;
+    
+    _layout = new QBoxLayout( this, dir, 0, 0);    
+	
+	_layout->setResizeMode( QLayout::FreeResize );
 
     // left/top hide button
     _ltHB = new KArrowButton(this);
@@ -395,7 +412,7 @@ void PanelContainer::resetLayout()
 
     // layout
     if( orientation() == Horizontal )
-	_layout->setDirection( QBoxLayout::LeftToRight );
+	_layout->setDirection( QApplication::reverseLayout() ? QBoxLayout::RightToLeft : QBoxLayout::LeftToRight );
     else
 	_layout->setDirection( QBoxLayout::TopToBottom );