[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Tue Apr 19 14:48:45 UTC 2005


CVS commit by okellogg: 

cosmetics


  M +22 -26    umlwidget.cpp   1.113


--- kdesdk/umbrello/umbrello/umlwidget.cpp  #1.112:1.113
@@ -245,4 +245,7 @@ void UMLWidget::mouseMoveEvent(QMouseEve
                 int newX = newPosition.x();
                 int newY = newPosition.y();
+                // kdDebug() << "UMLWidget::mouseMoveEvent(" << me->pos().x()
+                //        << "," << me->pos().y() << "): newPoint=("
+                //        << newX << "," << newY << ")" << endl;
 
                 m_nOldX = newX;
@@ -274,4 +277,10 @@ void UMLWidget::mousePressEvent(QMouseEv
                 return;
         }
+        if (me->button() != LeftButton && me->button() != RightButton) {
+                m_pView->clearSelected();
+                m_pView->resetToolbar();
+                setSelected(false);
+                return;
+        }
         if( me -> state() == ShiftButton || me -> state() == ControlButton )
         {
@@ -281,17 +290,15 @@ void UMLWidget::mousePressEvent(QMouseEv
                         m_bMouseDown = true;
                         m_bStartMove = true;
-                        setSelected( ( m_bSelected?false:true ) );
+                        setSelected( !m_bSelected );
                         m_pView -> setSelected( this, me );
-                        return;
-                } else if( me -> button() == RightButton ) {
+                } else {
                         if( !m_bSelected)
                                 m_pView -> setSelected( this, me );
                         setSelected( true );
+                }
                         return;
                 }
-        } else {
-                /* we have to save the shift state, because in ReleaseEvent it is lost */
                 m_bShiftPressed = false;
-        }//end shift
+        bool _select;
         if( me -> button() == LeftButton ) {
                 m_bMouseDown = true;
@@ -301,26 +308,15 @@ void UMLWidget::mousePressEvent(QMouseEv
                 if (count > 1 && m_bSelected == true)
                         return;
-
-                bool _select = m_bSelected?false:true;
-                m_pView -> clearSelected();
-                m_bSelected = _select;
-                setSelected( m_bSelected );
-                m_pView -> setSelected( this, me );
-        } else if( me -> button() == RightButton ) {
-
+                _select = !m_bSelected;
+        } else {
                 /* Right click on one element without holding any shift or ctrl key
                  * deselects all items and selects the current one. It will show the
                  * context menu for the selected item. This is common behaviour. */
-                m_pView -> clearSelected();
-                m_bSelected = true;
-                setSelected( m_bSelected );
-                m_pView -> setSelected( this, me );
-                return;
-        } else {
-
-                m_pView -> clearSelected();
-                m_pView -> resetToolbar();
-                setSelected( false );
+                _select = true;
         }
+        m_pView->clearSelected();
+        m_bSelected = _select;
+        setSelected(m_bSelected);
+        m_pView->setSelected(this, me);
 }
 






More information about the umbrello-devel mailing list