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

List:       kde-commits
Subject:    extragear/multimedia/amarok/src/contextview
From:       Seb Ruiz <me () sebruiz ! net>
Date:       2007-06-25 14:13:44
Message-ID: 1182780824.472340.2407.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 680139 by seb:

Simplify by removing ability to move multiple boxes at the same time (we can't even \
select multiple boxes at the same time).


 M  +6 -24     contextbox.cpp  


--- trunk/extragear/multimedia/amarok/src/contextview/contextbox.cpp #680138:680139
@@ -151,31 +151,14 @@
 {
     if ((event->buttons() & Qt::LeftButton) && (flags() & ItemIsMovable))
     {
-        // Determine the list of selected items
-        QList<QGraphicsItem *> selectedItems = scene()->selectedItems();
-        if( !isSelected() )
-            selectedItems << this;
-
-        // Move all selected items
-        foreach( QGraphicsItem *item, selectedItems )
+        if( (flags() & ItemIsMovable) && (!parentItem() || \
!parentItem()->isSelected()) )  {
-            if( (item->flags() & ItemIsMovable) && (!item->parentItem() || \
                !item->parentItem()->isSelected()) )
-            {
-                QPointF diff;
-                if( item == this )
-                {
-                    diff = mapToParent(event->pos()) - \
                mapToParent(event->lastPos());
-                }
-                else
-                {
-                    diff = item->mapToParent(item->mapFromScene(event->scenePos()))
-                            - \
                item->mapToParent(item->mapFromScene(event->lastScenePos()));
-                }
+            QPointF diff = mapToParent(event->pos()) - \
mapToParent(event->lastPos());  
-                item->moveBy( 0, diff.y() );
-                if( item->flags() & ItemIsSelectable )
-                    item->setSelected( true );
-            }
+            moveBy( 0, diff.y() );
+
+            if( flags() & ItemIsSelectable )
+                setSelected( true );
         }
     }
     else
@@ -184,7 +167,6 @@
     }
 }
 
-
 void ContextBox::toggleVisibility()
 {
     const qreal desiredHeight = m_goingUp ? m_optimumHeight : 0;


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

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