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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/containments/panel
From:       Marco Martin <notmart () gmail ! com>
Date:       2009-06-12 19:19:49
Message-ID: 1244834389.980115.30662.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 981058 by mart:

use a Spacer as last spacer: this means that drag and drop will work
also over it, pain--


 M  +10 -2     panel.cpp  
 M  +1 -1      panel.h  


--- trunk/KDE/kdebase/workspace/plasma/containments/panel/panel.cpp #981057:981058
@@ -56,7 +56,8 @@
 {
 public:
     Spacer(QGraphicsWidget *parent)
-         : QGraphicsWidget(parent)
+         : QGraphicsWidget(parent),
+           m_visible(true)
     {
         setAcceptDrops(true);
     }
@@ -65,6 +66,7 @@
     {}
 
     Panel *panel;
+    bool m_visible;
 
 protected:
     void dropEvent(QGraphicsSceneDragDropEvent *event)
@@ -78,6 +80,10 @@
         Q_UNUSED(option)
         Q_UNUSED(widget)
 
+        if (!m_visible) {
+            return;
+        }
+
         //TODO: make this a pretty gradient?
         painter->setRenderHint(QPainter::Antialiasing);
         QPainterPath p = Plasma::PaintUtils::roundedRectangle(contentsRect().adjusted(1, 1, -2, -2), 4);
@@ -252,7 +258,9 @@
 
     if (useSpacer) {
         if (!m_lastSpace) {
-            m_lastSpace = new QGraphicsWidget(this);
+            m_lastSpace = new Spacer(this);
+            m_lastSpace->panel = this;
+            m_lastSpace->m_visible = false;
             m_lastSpace->setPreferredSize(0,0);
             m_lastSpace->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
             lay->addItem(m_lastSpace);
--- trunk/KDE/kdebase/workspace/plasma/containments/panel/panel.h #981057:981058
@@ -89,7 +89,7 @@
     bool m_canResize;
     int m_spacerIndex;
     Spacer *m_spacer;
-    QGraphicsWidget *m_lastSpace;
+    Spacer *m_lastSpace;
     QTimer *m_lastSpaceTimer;
 
     friend class Spacer;
[prev in list] [next in list] [prev in thread] [next in thread] 

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