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

List:       kde-commits
Subject:    KDE/kdelibs/plasma/private
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2009-08-02 19:12:21
Message-ID: 1249240341.345826.3006.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1005998 by aseigo:

limit to 4 windows for now; need to improve the layout so it doesn't suck


 M  +10 -3     windowpreview.cpp  


--- trunk/KDE/kdelibs/plasma/private/windowpreview.cpp #1005997:1005998
@@ -75,7 +75,14 @@
         ids.clear();
         return;
     }
-    ids = wids;
+
+    //FIXME: need to get rid of this 4 window maximum by using a smarter layout
+    if (wids.count() < 5) {
+        ids = wids;
+    } else {
+        ids = wids.mid(0, 4);
+    }
+
     readWindowSizes();
     QSize s(sizeHint());
     if (s.isValid()) {
@@ -93,12 +100,14 @@
     if (ids.size() == 0) {
         return QSize();
     }
+
     if (!windowSizes.size() == 0) {
         readWindowSizes();
     }
 
     int maxHeight = 0;
     int totalWidth = 0;
+
     foreach (QSize s, windowSizes) {
         if (s.height() > maxHeight) {
             maxHeight = s.height();
@@ -113,9 +122,7 @@
     m_background->getMargins(left, top, right, bottom);
 
     s.scale(WINDOW_WIDTH*windowSizes.size(), WINDOW_HEIGHT, Qt::KeepAspectRatio);
-
     s = s + QSize(left+right+WINDOW_MARGIN*(windowSizes.size()-1), top+bottom);
-
     return s;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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