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

List:       kde-commits
Subject:    kdebase/kicker/taskbar
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2005-03-12 21:59:18
Message-ID: 20050312215918.6CA0D17B90 () office ! kde ! org
[Download RAW message or body]

CVS commit by aseigo: 

fix for fitt's "law" compliance when it's at the bottom of the screen.
basically, we add the padding to the top of the taskbar rather than just
let it accumulate at the bottom


  M +19 -3     taskbar.cpp   1.79


--- kdebase/kicker/taskbar/taskbar.cpp  #1.78:1.79
@@ -544,11 +544,25 @@ void TaskBar::reLayout()
             bwidth = contentsRect().width() / bpr;
             if (bwidth > TaskBarSettings::maximumButtonWidth())
+            {
                 bwidth = TaskBarSettings::maximumButtonWidth();
         }
+        }
 
         // layout containers
+
+        // for taskbars at the bottom, we need to ensure that the bottom
+        // buttons touch the bottom of the screen. since we layout from
+        // top to bottom this means seeing if we have any padding and
+        // popping it on the top. this preserves Fitt's Law behaviour
+        // for taskbars on the bottom
+        int topPadding = 0;
+        if (arrowType == UpArrow)
+        {
+            topPadding = contentsRect().height() % (rows * bheight);
+        }
+
         int i = 0;
         bool reverseLayout = QApplication::reverseLayout();
-        for ( TaskContainerIterator it(list); it.current(); ++it )
+        for (TaskContainerIterator it(list); it.current(); ++it, i++)
         {
             TaskContainer* c = it.current();
@@ -561,8 +576,9 @@ void TaskBar::reLayout()
             int x = ( i / rows ) * bwidth;
             if (reverseLayout)
+            {
                 x = contentsRect().width() - x - bwidth;
+            }
 
-            moveChild( c, x, row * bheight );
-            i++;
+            moveChild(c, x, (row * bheight) + topPadding);
         }
     }


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

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