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

List:       kde-commits
Subject:    playground/base/plasma/netbook/containments/sal
From:       Marco Martin <notmart () gmail ! com>
Date:       2009-07-28 19:09:16
Message-ID: 1248808156.294176.7413.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1003761 by mart:

some (sad) hacks to make the layouting of icons in the strip widget play
well


 M  +12 -3     stripwidget.cpp  


--- trunk/playground/base/plasma/netbook/containments/sal/stripwidget.cpp \
#1003760:1003761 @@ -66,14 +66,16 @@
     QGraphicsWidget *rightSpacer = new QGraphicsWidget(this);
     leftSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
     rightSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-    leftSpacer->setPreferredSize(0, 0);
-    rightSpacer->setPreferredSize(0, 0);
+    /*leftSpacer->setPreferredSize(0, 0);
+    rightSpacer->setPreferredSize(0, 0);*/
 
     m_arrowsLayout->addItem(leftArrow);
     m_arrowsLayout->addItem(leftSpacer);
+    //m_arrowsLayout->addStretch();
     m_arrowsLayout->addItem(m_stripLayout);
-    m_arrowsLayout->setStretchFactor(m_stripLayout, 8);
+    //m_arrowsLayout->setStretchFactor(m_stripLayout, 8);
     m_arrowsLayout->addItem(rightSpacer);
+    //m_arrowsLayout->addStretch();
     m_arrowsLayout->addItem(rightArrow);
 }
 
@@ -103,6 +105,8 @@
 
     m_favouritesIcons.insert(fav, match);
     m_stripLayout->insertItem(idx, widget);
+    m_stripLayout->setMaximumSize((fav->size().width())*m_stripLayout->count(), \
fav->size().height()); +    \
m_stripLayout->setMinimumSize(m_stripLayout->maximumSize());  }
 
 void StripWidget::add(Plasma::QueryMatch match, const QString &query)
@@ -153,7 +157,12 @@
 void StripWidget::removeFavourite()
 {
     Plasma::IconWidget *icon = static_cast<Plasma::IconWidget*>(sender()->parent());
+
     remove(icon);
+
+    //FIXME
+    m_stripLayout->setMinimumSize(icon->size().width()*(m_stripLayout->count()-1), \
icon->size().height()); +    \
m_stripLayout->setMaximumSize(m_stripLayout->minimumSize());  }
 
 void StripWidget::launchFavourite()


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

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