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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/quicklaunch
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2009-06-24 22:19:12
Message-ID: 1245881952.007576.30257.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 986707 by aseigo:

better vertical behaviour


 M  +4 -3      quicklaunchApplet.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchApplet.cpp #986706:986707
@@ -202,15 +202,16 @@
 
     int rowCount;
     if (formFactor() == Plasma::Vertical) {
-        rowCount = contentsRect().width() / m_iconSize;
+        int numIcons = qMin(m_icons.count(), m_visibleIcons);
+        int colCount = qMax(qreal(1), contentsRect().width() / m_iconSize);
+        rowCount = numIcons / colCount + numIcons % colCount;
         // prevent possible division by zero if size().width() is 0
-        rowCount = qMax(1, rowCount );
     } else {
         rowCount = contentsRect().height() / m_iconSize;
         // prevent possible division by zero if size().height() is 0
-        rowCount = qMax(1, rowCount);
     }
 
+    rowCount = qMax(1, rowCount);
     m_innerLayout->setPreferredRowCount(rowCount);
     int count = 0;
     //kDebug() << m_icons.count() << "pixel icons in" << rowCount
[prev in list] [next in list] [prev in thread] [next in thread] 

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