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

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/plasma
From:       Marco Martin <notmart () gmail ! com>
Date:       2008-04-20 14:23:38
Message-ID: 1208701418.470403.14750.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 799135 by mart:

- boundingRect() now is pure virtual in Toolbox class
- correctly places the toolbox in vertical panels

 M  +4 -2      containment.cpp  
 M  +10 -0     desktoptoolbox.cpp  
 M  +1 -0      desktoptoolbox_p.h  
 M  +5 -0      paneltoolbox.cpp  
 M  +1 -1      paneltoolbox_p.h  
 M  +0 -9      toolbox.cpp  
 M  +0 -1      toolbox_p.h  


--- trunk/KDE/kdebase/workspace/libs/plasma/containment.cpp #799134:799135
@@ -252,10 +252,12 @@
         //The placement assumes that the geometry width/height is no more than the \
screen  if (d->type == PanelContainment) {
             if (formFactor() == Vertical) {
-                d->toolbox->setPos(geometry().width()/2 - \
d->toolbox->boundingRect().width()/2, geometry().bottom()); +                \
d->toolbox->setOrientation(Qt::Vertical); +                \
d->toolbox->setPos(geometry().width()/2 - d->toolbox->boundingRect().width()/2, \
geometry().height());  //defaulting to Horizontal right now
             } else {
-                d->toolbox->setPos(geometry().right(), geometry().height()/2 - \
d->toolbox->boundingRect().height()/2); +                \
d->toolbox->setOrientation(Qt::Horizontal); +                \
d->toolbox->setPos(geometry().width(), geometry().height()/2 - \
d->toolbox->boundingRect().height()/2);  }
         } else {
             d->toolbox->setPos(geometry().right() - \
                qAbs(d->toolbox->boundingRect().width()), 0);
--- trunk/KDE/kdebase/workspace/libs/plasma/desktoptoolbox.cpp #799134:799135
@@ -98,8 +98,18 @@
       d(new Private)
 {
     connect(Plasma::Phase::self(), SIGNAL(movementComplete(QGraphicsItem*)), this, \
SLOT(toolMoved(QGraphicsItem*))); +
+    setZValue(10000000);
+    setFlag(ItemClipsToShape, true);
+    setFlag(ItemClipsChildrenToShape, false);
+    setFlag(ItemIgnoresTransformations, true);
 }
 
+QRectF DesktopToolbox::boundingRect() const
+{
+    return QRectF(0, 0, -size()*2, size()*2);
+}
+
 void DesktopToolbox::paint(QPainter *painter, const QStyleOptionGraphicsItem \
*option, QWidget *widget)  {
     Q_UNUSED(option)
--- trunk/KDE/kdebase/workspace/libs/plasma/desktoptoolbox_p.h #799134:799135
@@ -43,6 +43,7 @@
 
 public:
     explicit DesktopToolbox(QGraphicsItem *parent = 0);
+    QRectF boundingRect() const;
     QPainterPath shape() const;
 
     void showToolbox();
--- trunk/KDE/kdebase/workspace/libs/plasma/paneltoolbox.cpp #799134:799135
@@ -97,6 +97,11 @@
       d(new Private)
 {
     connect(Plasma::Phase::self(), SIGNAL(movementComplete(QGraphicsItem*)), this, \
SLOT(toolMoved(QGraphicsItem*))); +
+    setZValue(10000000);
+    setFlag(ItemClipsToShape, true);
+    setFlag(ItemClipsChildrenToShape, false);
+    setFlag(ItemIgnoresTransformations, true);
 }
 
 QRectF PanelToolbox::boundingRect() const
--- trunk/KDE/kdebase/workspace/libs/plasma/paneltoolbox_p.h #799134:799135
@@ -43,7 +43,7 @@
 
 public:
     explicit PanelToolbox(QGraphicsItem *parent = 0);
-    virtual QRectF boundingRect() const;
+    QRectF boundingRect() const;
     QPainterPath shape() const;
 
     void showToolbox();
--- trunk/KDE/kdebase/workspace/libs/plasma/toolbox.cpp #799134:799135
@@ -59,17 +59,8 @@
       d(new Private)
 {
     setAcceptsHoverEvents(true);
-    setZValue(10000000);
-    setFlag(ItemClipsToShape, true);
-    setFlag(ItemClipsChildrenToShape, false);
-    setFlag(ItemIgnoresTransformations, true);
 }
 
-QRectF Toolbox::boundingRect() const
-{
-    return QRectF(0, 0, -size()*2, size()*2);
-}
-
 void Toolbox::addTool(QGraphicsItem *tool, const QString &name)
 {
     if (!tool) {
--- trunk/KDE/kdebase/workspace/libs/plasma/toolbox_p.h #799134:799135
@@ -38,7 +38,6 @@
 
 public:
     explicit Toolbox(QGraphicsItem *parent = 0);
-    virtual QRectF boundingRect() const;
 
     void addTool(QGraphicsItem *tool, const QString &name);
     void enableTool(const QString &tool, bool enabled);


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

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