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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/quicklaunch
From:       Lukas Appelhans <l.appelhans () gmx ! de>
Date:       2009-05-11 17:16:55
Message-ID: 1242062215.009012.22959.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 966646 by lappelhans:

Don't do endless loops nor accept icon sizes > applet's height


 M  +4 -5      quicklaunchApplet.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchApplet.cpp \
#966645:966646 @@ -173,15 +173,14 @@
     kDebug() << "performUiRefactor count = " << my_perforcount++;
     clearLayout(m_innerLayout);
 
-    m_iconSize = qMax(m_iconSize, s_defaultIconSize);//Don't accept values under 16
+    m_iconSize = qMin(qMax(m_iconSize, s_defaultIconSize), \
(int)(contentsRect().height() - 2 * s_defaultSpacing));//Don't accept values under 16 \
nor anything over applet's height  m_dialogIconSize = qMax(m_iconSize, \
s_defaultIconSize);  
     if (m_dialogLayout) {
         clearLayout(m_dialogLayout);
-        m_dialogLayout->setRowCount((int)(size().height() / m_dialogIconSize));
+        m_dialogLayout->setRowCount((int)(size().height() / qMin(m_dialogIconSize, \
m_dialog->size().height())));  }
     int rowCount;
-    int iconWidth;
     if (formFactor() == Plasma::Vertical) {
         rowCount = contentsRect().width() / m_iconSize;
         // prevent possible division by zero if size().width() is 0
@@ -194,7 +193,7 @@
 
     m_innerLayout->setRowCount(rowCount);
     int count = 0;
-    kDebug() << m_icons.count() << iconWidth << "pixel icons in" << rowCount
+    kDebug() << m_icons.count() << "pixel icons in" << rowCount
              << "rows, with a max of" << m_visibleIcons << "visible";
     foreach (QuicklaunchIcon *icon, m_icons) {
         //icon->setMinimumSize(minSize);
@@ -234,7 +233,7 @@
         m_dialog->adjustSize();
     }
 
-    resize(sizeHint(Qt::PreferredSize));
+    //resize(sizeHint(Qt::PreferredSize));
     kDebug() << "Bar see";
     update();
 }


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

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