[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE_3_2_BRANCH: kdelibs/kdeui
From:       Waldo Bastian <bastian () kde ! org>
Date:       2004-05-25 13:37:16
Message-ID: 20040525133716.D344A15C0 () office ! kde ! org
[Download RAW message or body]

CVS commit by waba: 

* React faster to window resizing (BR75417)
* Fixed loop where the arrow menu triggers relayouts every 100ms.


  M +19 -5     ktoolbar.cpp   1.369.2.7


--- kdelibs/kdeui/ktoolbar.cpp  #1.369.2.6:1.369.2.7
@@ -1305,9 +1305,12 @@ void KToolBar::childEvent( QChildEvent *
 {
     if ( e->child()->isWidgetType() ) {
-        QWidget * w = (QWidget*)e->child();
+        QWidget * w = dynamic_cast<QWidget *>(e->child());
+        if (!w || (::qstrcmp( "qt_dockwidget_internal", w->name()) == 0))
+        {
+           QToolBar::childEvent( e );
+           return;
+        }
         if ( e->type() == QEvent::ChildInserted ) {
-            if ( !dynamic_cast<QPopupMenu *>(e->child()) && // e->child() is not a QPopupMenu
-                 ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) {
-
+            if ( !dynamic_cast<QPopupMenu *>(w)) { // e->child() is not a QPopupMenu
                 // prevent items that have been explicitly inserted by insert*() from
                 // being inserted again
@@ -1464,5 +1467,16 @@ void KToolBar::resizeEvent( QResizeEvent
     QToolBar::resizeEvent( e );
     if (b)
+    {
+      if (layoutTimer->isActive())
+      {
+         // Wait with repainting till layout is complete.
        d->repaintTimer.start( 100, true );
+      }
+      else
+      {
+         // Repaint now
+         slotRepaint();
+      }
+    }
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic