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

List:       koffice-devel
Subject:    [patch] Color button behavior in KWord, KPresenter, KSpread, Kivio
From:       Sven Langkamp <longamp () reallygood ! de>
Date:       2004-10-30 14:33:01
Message-ID: 200410301633.02336.longamp () reallygood ! de
[Download RAW message or body]

Hi,
I have now implemented the behaviour suggested in 52001 for the text, line and 
fill toolbar buttons in KWord, KPresenter, KSpread and Kivio. Comments?

["colorbutton2.diff" (text/x-diff)]

? kexi/main/startup/KexiNewProjectWizard.loT
Index: kivio/kiviopart/kivio_view.cpp
===================================================================
RCS file: /home/kde/koffice/kivio/kiviopart/kivio_view.cpp,v
retrieving revision 1.164
diff -u -r1.164 kivio_view.cpp
--- kivio/kiviopart/kivio_view.cpp	21 Oct 2004 13:05:00 -0000	1.164
+++ kivio/kiviopart/kivio_view.cpp	30 Oct 2004 14:14:55 -0000
@@ -1330,10 +1330,6 @@
 
         m_menuTextFormatAction->setEnabled( false );
         m_menuStencilConnectorsAction->setEnabled( false );
-
-        m_setFGColor->setCurrentColor(QColor(0, 0, 0));
-        m_setBGColor->setCurrentColor(QColor(255, 255, 255));
-        m_setTextColor->setCurrentColor(QColor(0, 0, 0));
     }
     else
     {
@@ -1348,10 +1344,6 @@
         m_lineWidthAction->setCurrentWidth(pStencil->lineWidth());
         m_lineStyleAction->setCurrentSelection(pStencil->linePattern());
 
-        m_setFGColor->setCurrentColor(pStencil->fgColor());
-        m_setBGColor->setCurrentColor(pStencil->bgColor());
-        m_setTextColor->setCurrentColor(pStencil->textColor());
-
         showAlign(pStencil->hTextAlign());
         showVAlign(pStencil->vTextAlign());
 
Index: kpresenter/kprcanvas.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kprcanvas.cc,v
retrieving revision 1.438
diff -u -r1.438 kprcanvas.cc
--- kpresenter/kprcanvas.cc	24 Oct 2004 06:50:46 -0000	1.438
+++ kpresenter/kprcanvas.cc	30 Oct 2004 14:15:18 -0000
@@ -1305,8 +1305,6 @@
                 }
 #endif
 
-                m_view->penColorChanged( m_activePage->getPen( QPen( Qt::black, 1, \
                Qt::SolidLine ) ) );
-                m_view->brushColorChanged( m_activePage->getBrush( QBrush( \
Qt::white, Qt::SolidPattern ) ) );  mouseSelectedObject = true;
                 _repaint( false );
                 emit objectSelectedChanged();
@@ -1731,9 +1729,6 @@
                 p.end();
 
                 mouseSelectedObject = true;
-
-                m_view->penColorChanged( m_view->getPen() );
-                m_view->brushColorChanged( m_view->getBrush() );
             } break;
             case INS_ELLIPSE: {
                 QPainter p( this );
@@ -1773,9 +1768,6 @@
                 p.end();
 
                 mouseSelectedObject = true;
-
-                m_view->penColorChanged( m_view->getPen() );
-                m_view->brushColorChanged( m_view->getBrush() );
             } break;
             case INS_RECT: {
                 QPainter p( this );
@@ -1814,9 +1806,6 @@
                 p.end();
 
                 mouseSelectedObject = true;
-
-                m_view->penColorChanged( m_view->getPen() );
-                m_view->brushColorChanged( m_view->getBrush() );
             } break;
             case INS_LINE: {
                 QPainter p( this );
@@ -1864,9 +1853,6 @@
                 p.end();
 
                 mouseSelectedObject = true;
-
-                m_view->penColorChanged( m_view->getPen() );
-                m_view->brushColorChanged( m_view->getBrush() );
             } break;
             case INS_PIE: {
                 QPainter p( this );
@@ -1904,9 +1890,6 @@
                 p.end();
 
                 mouseSelectedObject = true;
-
-                m_view->penColorChanged( m_view->getPen() );
-                m_view->brushColorChanged( m_view->getBrush() );
             } break;
             case INS_FREEHAND: case INS_CLOSED_FREEHAND: {
                 m_dragEndPoint = QPoint( e->x() , e->y() );
@@ -1927,9 +1910,6 @@
                 m_dragStartPoint = m_dragEndPoint;
 
                 mouseSelectedObject = true;
-
-                m_view->penColorChanged( m_view->getPen() );
-                m_view->brushColorChanged( m_view->getBrush() );
             } break;
             case INS_POLYLINE: case INS_CLOSED_POLYLINE: {
                 QPainter p( this );
@@ -1959,9 +1939,6 @@
                 p.end();
 
                 mouseSelectedObject = true;
-
-                m_view->penColorChanged( m_view->getPen() );
-                m_view->brushColorChanged( m_view->getBrush() );
             } break;
             case INS_CUBICBEZIERCURVE: case INS_QUADRICBEZIERCURVE:
             case INS_CLOSED_CUBICBEZIERCURVE: case INS_CLOSED_QUADRICBEZIERCURVE:{
@@ -1971,9 +1948,6 @@
                                       tmp.y());
 
                 mouseSelectedObject = true;
-
-                m_view->penColorChanged( m_view->getPen() );
-                m_view->brushColorChanged( m_view->getBrush() );
             } break;
             case INS_POLYGON: {
                 drawPolygon( m_view->zoomHandler()->unzoomPoint( m_dragStartPoint ),
@@ -1988,9 +1962,6 @@
                              m_view->zoomHandler()->unzoomPoint( m_dragEndPoint ) ); \
// draw new polygon  
                 mouseSelectedObject = true;
-
-                m_view->penColorChanged( m_view->getPen() );
-                m_view->brushColorChanged( m_view->getBrush() );
             } break;
             default: break;
             }
@@ -2414,8 +2385,6 @@
 void KPrCanvas::selectObj( KPObject *kpobject )
 {
     kpobject->setSelected( true );
-    m_view->penColorChanged( m_activePage->getPen( QPen( Qt::black, 1, Qt::SolidLine \
                ) ) );
-    m_view->brushColorChanged( m_activePage->getBrush( QBrush( Qt::white, \
Qt::SolidPattern ) ) );  _repaint( kpobject );
     emit objectSelectedChanged();
 
@@ -2455,8 +2424,6 @@
     }
 #endif
 
-    m_view->penColorChanged( m_activePage->getPen( QPen( Qt::black, 1, Qt::SolidLine \
                ) ) );
-    m_view->brushColorChanged( m_activePage->getBrush( QBrush( Qt::white, \
Qt::SolidPattern ) ) );  mouseSelectedObject = true;
     _repaint( false );
     emit objectSelectedChanged();
@@ -2485,10 +2452,6 @@
     m_activePage->masterPage()->deSelectAllObj();
 #endif
 
-    // set current default pen color and brush color in tool bar
-    m_view->penColorChanged( m_view->getPen() );
-    m_view->brushColorChanged( m_view->getBrush() );
-
     //desactivate kptextview when we switch of page
     if(m_currentTextObjectView)
     {
Index: kpresenter/kpresenter_view.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kpresenter_view.cc,v
retrieving revision 1.1058
diff -u -r1.1058 kpresenter_view.cc
--- kpresenter/kpresenter_view.cc	19 Oct 2004 08:44:20 -0000	1.1058
+++ kpresenter/kpresenter_view.cc	30 Oct 2004 14:15:35 -0000
@@ -4735,11 +4735,8 @@
     actionTextUnderline->setChecked( currentFormat.underline());
     actionFormatStrikeOut->setChecked( currentFormat.strikeOut());
 
-    QColor col=currentFormat.textBackgroundColor();
     actionBrushColor->setEnabled(true);
-    actionBrushColor->setCurrentColor( col.isValid() ? col : \
QApplication::palette().color( QPalette::Active, QColorGroup::Base ));  \
                //actionBrushColor->setText(i18n("Text Background Color..."));
-    actionTextColor->setCurrentColor( currentFormat.color() );
 
     switch(currentFormat.vAlign())
     {
Index: kspread/kspread_view.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_view.cc,v
retrieving revision 1.797
diff -u -r1.797 kspread_view.cc
--- kspread/kspread_view.cc	23 Oct 2004 13:58:11 -0000	1.797
+++ kspread/kspread_view.cc	30 Oct 2004 14:15:55 -0000
@@ -1438,18 +1438,6 @@
 {
     toolbarLock = TRUE;
 
-    QColor color=cell->textColor( column, row );
-    if (!color.isValid())
-        color=QApplication::palette().active().text();
-    actions->textColor->setCurrentColor( color );
-
-    color=cell->bgColor(  column, row );
-
-    if ( !color.isValid() )
-        color = QApplication::palette().active().base();
-
-    actions->bgColor->setCurrentColor( color );
-
     actions->selectFontSize->setFontSize( cell->textFontSize( column, row ) );
     actions->selectFont->setFont( cell->textFontFamily( column,row ) );
     actions->bold->setChecked( cell->textFontBold( column, row ) );
Index: kword/kwview.cc
===================================================================
RCS file: /home/kde/koffice/kword/kwview.cc,v
retrieving revision 1.1049
diff -u -r1.1049 kwview.cc
--- kword/kwview.cc	20 Oct 2004 21:34:05 -0000	1.1049
+++ kword/kwview.cc	30 Oct 2004 14:16:20 -0000
@@ -1816,7 +1816,6 @@
         actionBackgroundColor->setText(i18n("Frame Background Color..."));
     else
         actionBackgroundColor->setText(i18n("Text Background Color..."));
-    actionFormatColor->setCurrentColor( currentFormat.color() );
     switch(currentFormat.vAlign())
       {
       case KoTextFormat::AlignSuperScript:
Index: lib/kofficeui/tkcoloractions.cpp
===================================================================
RCS file: /home/kde/koffice/lib/kofficeui/tkcoloractions.cpp,v
retrieving revision 1.30
diff -u -r1.30 tkcoloractions.cpp
--- lib/kofficeui/tkcoloractions.cpp	21 Sep 2003 17:35:00 -0000	1.30
+++ lib/kofficeui/tkcoloractions.cpp	30 Oct 2004 14:16:24 -0000
@@ -240,8 +240,7 @@
 void TKSelectColorAction::slotActivated()
 {
   //kdDebug() << "TKSelectColorAction::slotActivated" << endl;
-  // The goal is to select a color !
-  selectColorDialog();
+  activate();
 }
 
 void TKSelectColorAction::activate()



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


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

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