[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Wed Mar 1 10:58:07 UTC 2006


SVN commit 514870 by okellogg:

http://www.geeksoc.org/~jr/umbrello/uml-devel/9265.html
>From Yan Morin <yansanmo.site_at_gmail.com>
> [...] a patch to select the first element fill color or line color when 
> you right click on it. 
http://www.geeksoc.org/~jr/umbrello/uml-devel/att-9265/umbrello_selectFirstColor.patch


 M  +7 -0      umlview.h  
 M  +6 -0      umlwidget.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlview.h #514869:514870
@@ -911,6 +911,13 @@
     }
 
     /**
+     * Return pointer to the first selected widget (for multi-selection)
+     */
+    UMLWidget* getFirstMultiSelectedWidget() {
+        return m_SelectedList.first();
+    }
+
+    /**
      * Return the current UMLWidget we are on.
      */
     UMLWidget * getOnWidget() {
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlwidget.cpp #514869:514870
@@ -482,6 +482,8 @@
     QFont font;
     QColor newColour;
     const Uml::Widget_Type wt = m_Type;
+    UMLWidget* widget = 0; // use for select the first object properties (fill, line color)
+
     switch(sel) {
     case ListPopupMenu::mt_Rename:
         m_pDoc -> renameUMLObject(m_pObject);
@@ -510,6 +512,8 @@
 
     case ListPopupMenu::mt_Line_Color:
     case ListPopupMenu::mt_Line_Color_Selection:
+        widget = m_pView->getFirstMultiSelectedWidget();
+        if (widget) { newColour = widget->getLineColor(); }
         if( KColorDialog::getColor(newColour) ) {
             m_pView -> selectionSetLineColor( newColour );
             m_pDoc -> setModified(true);
@@ -518,6 +522,8 @@
 
     case ListPopupMenu::mt_Fill_Color:
     case ListPopupMenu::mt_Fill_Color_Selection:
+        widget = m_pView->getFirstMultiSelectedWidget();
+        if (widget) { newColour = widget->getFillColour(); }
         if ( KColorDialog::getColor(newColour) ) {
             m_pView -> selectionSetFillColor( newColour );
             m_pDoc -> setModified(true);




More information about the umbrello-devel mailing list