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

List:       kde-commits
Subject:    extragear/plasma/applets/kolourpicker
From:       Jason Stubbs <jasonbstubbs () gmail ! com>
Date:       2008-01-05 6:45:01
Message-ID: 1199515501.484645.30260.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 757509 by jstubbs:

Layout buttons horizontally when they won't fit horizontally and don't take
more space then necessary.


 M  +14 -0     kolourpicker.cpp  
 M  +1 -0      kolourpicker.h  


--- trunk/extragear/plasma/applets/kolourpicker/kolourpicker.cpp #757508:757509
@@ -177,8 +177,22 @@
         m_historyButton->adaptToFormFactor(formFactor());
         layout()->invalidate();
     }
+
+    if (constraints & Plasma::SizeConstraint) {
+        Plasma::BoxLayout *l = dynamic_cast<Plasma::BoxLayout *>(layout());
+        if (l->minimumSize().height() > geometry().size().height()) {
+            l->setDirection(Plasma::BoxLayout::LeftToRight);
+        } else {
+            l->setDirection(Plasma::BoxLayout::TopToBottom);
+        }
+    }
 }
 
+Qt::Orientations Kolourpicker::expandingDirections() const
+{
+    return 0;
+}
+
 bool Kolourpicker::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
 {
     if (watched == m_grabButton && event->type() == QEvent::GraphicsSceneMouseRelease)
--- trunk/extragear/plasma/applets/kolourpicker/kolourpicker.h #757508:757509
@@ -28,6 +28,7 @@
         ~Kolourpicker();
 
         void constraintsUpdated(Plasma::Constraints constraints);
+        Qt::Orientations expandingDirections() const;
 
     protected:
         virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
[prev in list] [next in list] [prev in thread] [next in thread] 

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