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

List:       kde-commits
Subject:    branches/KDE/3.5/kdebase/kicker/libkicker
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2005-10-25 13:23:32
Message-ID: 1130246612.378786.16935.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 474084 by aseigo:

when we have scroll buttons, set a minimum width so that we don't get
infinite looping when it hides the buttons (which in turn would make the
panner smaller than the buttons, making it show them again, making the
panner...)

half of the fix to BR#114084
CCBUG:114084


 M  +17 -5     panner.cpp  


--- branches/KDE/3.5/kdebase/kicker/libkicker/panner.cpp #474083:474084
@@ -69,6 +69,7 @@
             _rdSB->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
             QToolTip::add(_luSB, i18n("Scroll left"));
             QToolTip::add(_rdSB, i18n("Scroll right"));
+            setMinimumSize(24, 0);
         }
         _layout->setDirection(QBoxLayout::LeftToRight);
     }
@@ -82,6 +83,7 @@
             _rdSB->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
             QToolTip::add(_luSB, i18n("Scroll up"));
             QToolTip::add(_rdSB, i18n("Scroll down"));
+            setMinimumSize(0, 24);
         }
         _layout->setDirection(QBoxLayout::TopToBottom);
     }
@@ -147,12 +149,22 @@
 
 void Panner::updateScrollButtons()
 {
-    if ((orientation() == Horizontal && contentsWidth() - 1 > width()) ||
-        (orientation() == Vertical && contentsHeight() - 1 > height()))
+    int delta = 0;
+
+    if (orientation() == Horizontal)
     {
+        delta = contentsWidth() - width();
+    }
+    else
+    {
+        delta = contentsHeight() - height();
+    }
+
+    if (delta > 1)
+    {
         createScrollButtons();
 
-        // since they buttons may be visible but of the wrong size
+        // since the buttons may be visible but of the wrong size
         // we need to do this every single time
         _luSB->show();
         _rdSB->show();
@@ -160,12 +172,12 @@
         if (orientation() == Horizontal)
         {
             setMargins(leftMargin(), topMargin(),
-                        _luSB->width() + _rdSB->width(), bottomMargin());
+                       _luSB->width() + _rdSB->width(), bottomMargin());
         }
         else
         {
             setMargins(leftMargin(), topMargin(),
-                        rightMargin(), _luSB->height() + _rdSB->height());
+                       rightMargin(), _luSB->height() + _rdSB->height());
         }
     }
     else if (_luSB && _luSB->isVisibleTo(this))
[prev in list] [next in list] [prev in thread] [next in thread] 

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