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

List:       kde-commits
Subject:    [kdelibs/KDE/4.10] plasma: consider also declarative items for parentSize
From:       Marco Martin <notmart () gmail ! com>
Date:       2012-12-28 17:46:39
Message-ID: 20121228174639.C6FADA6091 () git ! kde ! org
[Download RAW message or body]

Git commit 2dfedfafc040a2f45966dcd554a497ead2ce450a by Marco Martin.
Committed on 28/12/2012 at 18:45.
Pushed by mart into branch 'KDE/4.10'.

consider also declarative items for parentSize

this fixes applets collapse in the new qml systray

M  +4    -0    plasma/popupapplet.cpp

http://commits.kde.org/kdelibs/2dfedfafc040a2f45966dcd554a497ead2ce450a

diff --git a/plasma/popupapplet.cpp b/plasma/popupapplet.cpp
index d1f6e66..412414a 100644
--- a/plasma/popupapplet.cpp
+++ b/plasma/popupapplet.cpp
@@ -27,6 +27,7 @@
 #include <QGraphicsLinearLayout>
 #include <QTimer>
 #include <QVBoxLayout>
+#include <QDeclarativeItem>
 
 #ifdef Q_WS_X11
 #include <QX11Info>
@@ -242,10 +243,13 @@ void \
PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)  
         //99% of the times q->parentWidget() is the containment, but using it  we \
                can also manage the applet-in-applet case (i.e. systray)
         //there are also cases where the parentlayoutitem is bigger than the \
containment (e.g. newspaper) +        QDeclarativeItem *di = \
qobject_cast<QDeclarativeItem *>(q->parentObject());  if (q->parentLayoutItem()) {
             parentSize = q->parentLayoutItem()->geometry().size();
         } else if (q->parentWidget()) {
             parentSize = q->parentWidget()->size();
+        } else if (di) {
+            parentSize = QSizeF(di->width(), di->height());
         }
 
         //check if someone did the nasty trick of applets in applets, in this case \
we always want to be collapsed


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

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