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

List:       kde-commits
Subject:    koffice/kspread/ui
From:       Stefan Nikolaus <nikolaus.kde () googlemail ! com>
Date:       2010-07-01 14:46:41
Message-ID: 20100701144641.9F804AC8E3 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1145033 by nikolaus:

Commands	Border actions.
		Use the user-defined color (default: black) for the border actions.



 M  +23 -16    CellToolBase.cpp  


--- trunk/koffice/kspread/ui/CellToolBase.cpp #1145032:1145033
@@ -349,6 +349,7 @@
     action->setIcon(KIcon("format-stroke-color"));
     action->setToolTip(i18n("Select a new border color"));
     action->setText(i18n("Border Color"));
+    static_cast<KoColorPopupAction*>(action)->setCurrentColor(Qt::black);
     addAction("borderColor", action);
     connect(action, SIGNAL(colorChanged(const KoColor &)), this, \
SLOT(borderColor(const KoColor &)));  
@@ -1815,61 +1816,66 @@
 
 void CellToolBase::borderLeft()
 {
+    QColor color = static_cast<KoColorPopupAction*>(action("borderColor"))->currentColor();
  StyleCommand* command = new StyleCommand();
     command->setSheet(selection()->activeSheet());
     command->setText(i18n("Change Border"));
     if (selection()->activeSheet()->layoutDirection() == Qt::RightToLeft)
-        command->setRightBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
1, Qt::SolidLine)); +        command->setRightBorderPen(QPen(color, 1, \
Qt::SolidLine));  else
-        command->setLeftBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
1, Qt::SolidLine)); +        command->setLeftBorderPen(QPen(color, 1, \
Qt::SolidLine));  command->add(*selection());
     command->execute(canvas());
 }
 
 void CellToolBase::borderRight()
 {
+    QColor color = static_cast<KoColorPopupAction*>(action("borderColor"))->currentColor();
  StyleCommand* command = new StyleCommand();
     command->setSheet(selection()->activeSheet());
     command->setText(i18n("Change Border"));
     if (selection()->activeSheet()->layoutDirection() == Qt::RightToLeft)
-        command->setLeftBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
1, Qt::SolidLine)); +        command->setLeftBorderPen(QPen(color, 1, \
Qt::SolidLine));  else
-        command->setRightBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
1, Qt::SolidLine)); +        command->setRightBorderPen(QPen(color, 1, \
Qt::SolidLine));  command->add(*selection());
     command->execute(canvas());
 }
 
 void CellToolBase::borderTop()
 {
+    QColor color = static_cast<KoColorPopupAction*>(action("borderColor"))->currentColor();
  StyleCommand* command = new StyleCommand();
     command->setSheet(selection()->activeSheet());
     command->setText(i18n("Change Border"));
-    command->setTopBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
1, Qt::SolidLine)); +    command->setTopBorderPen(QPen(color, 1, Qt::SolidLine));
     command->add(*selection());
     command->execute(canvas());
 }
 
 void CellToolBase::borderBottom()
 {
+    QColor color = static_cast<KoColorPopupAction*>(action("borderColor"))->currentColor();
  StyleCommand* command = new StyleCommand();
     command->setSheet(selection()->activeSheet());
     command->setText(i18n("Change Border"));
-    command->setBottomBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
1, Qt::SolidLine)); +    command->setBottomBorderPen(QPen(color, 1, Qt::SolidLine));
     command->add(*selection());
     command->execute(canvas());
 }
 
 void CellToolBase::borderAll()
 {
+    QColor color = static_cast<KoColorPopupAction*>(action("borderColor"))->currentColor();
  StyleCommand* command = new StyleCommand();
     command->setSheet(selection()->activeSheet());
     command->setText(i18n("Change Border"));
-    command->setTopBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
                1, Qt::SolidLine));
-    command->setBottomBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
                1, Qt::SolidLine));
-    command->setLeftBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
                1, Qt::SolidLine));
-    command->setRightBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
                1, Qt::SolidLine));
-    command->setHorizontalPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
                1, Qt::SolidLine));
-    command->setVerticalPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
1, Qt::SolidLine)); +    command->setTopBorderPen(QPen(color, 1, Qt::SolidLine));
+    command->setBottomBorderPen(QPen(color, 1, Qt::SolidLine));
+    command->setLeftBorderPen(QPen(color, 1, Qt::SolidLine));
+    command->setRightBorderPen(QPen(color, 1, Qt::SolidLine));
+    command->setHorizontalPen(QPen(color, 1, Qt::SolidLine));
+    command->setVerticalPen(QPen(color, 1, Qt::SolidLine));
     command->add(*selection());
     command->execute(canvas());
 }
@@ -1891,13 +1897,14 @@
 
 void CellToolBase::borderOutline()
 {
+    QColor color = static_cast<KoColorPopupAction*>(action("borderColor"))->currentColor();
  StyleCommand* command = new StyleCommand();
     command->setSheet(selection()->activeSheet());
     command->setText(i18n("Change Border"));
-    command->setTopBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
                1, Qt::SolidLine));
-    command->setBottomBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
                1, Qt::SolidLine));
-    command->setLeftBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
                1, Qt::SolidLine));
-    command->setRightBorderPen(QPen(canvas()->resourceManager()->foregroundColor().toQColor(), \
1, Qt::SolidLine)); +    command->setTopBorderPen(QPen(color, 1, Qt::SolidLine));
+    command->setBottomBorderPen(QPen(color, 1, Qt::SolidLine));
+    command->setLeftBorderPen(QPen(color, 1, Qt::SolidLine));
+    command->setRightBorderPen(QPen(color, 1, Qt::SolidLine));
     command->add(*selection());
     command->execute(canvas());
 }


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

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