[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Tue Apr 5 18:33:57 CEST 2005


CVS commit by staikos: 

add a flag for "color mode", which is monochrome, greyscale, or colour (default)
This can be used, once implemented in KstColorSequence functions, for both
display and printing purposes.  We can have a submenu of Settings/ to choose
the mode, and likewise have options in the print settings panel.


  M +21 -1     kstcolorsequence.cpp   1.16
  M +4 -0      kstcolorsequence.h   1.7


--- kdeextragear-2/kst/kst/kstcolorsequence.cpp  #1.15:1.16
@@ -40,5 +40,6 @@ static KStaticDeleter<KstColorSequence> 
 
 
-KstColorSequence::KstColorSequence() : _ptr(0) {
+KstColorSequence::KstColorSequence()
+: _ptr(0), _mode(Color) {
   _pal = new KPalette("Kst Colors");
 
@@ -220,3 +221,22 @@ bool KstColorSequence::colorsTooClose(co
 }
 
+
+KstColorSequence::ColorMode KstColorSequence::colorMode() {
+  if (!_self) {
+    sdColorSequence.setObject(_self, new KstColorSequence);
+  }
+
+  return _self->_mode;
+}
+
+
+void KstColorSequence::setColorMode(KstColorSequence::ColorMode mode) {
+  if (!_self) {
+    sdColorSequence.setObject(_self, new KstColorSequence);
+  }
+
+  _self->_mode = mode;
+}
+
+
 // vim: ts=2 sw=2 et

--- kdeextragear-2/kst/kst/kstcolorsequence.h  #1.6:1.7
@@ -28,8 +28,11 @@ class KstColorSequence {
   friend class KStaticDeleter<KstColorSequence>;
   public:
+    enum ColorMode { MonoChrome, GrayScale, Color };
     static QColor next();
     static QColor next(const QColor& badColor);
     static QColor next(const KstBaseCurveList& Curves, const QColor& badColor);
     static bool colorsTooClose(const QColor& color, const QColor& badColor);
+    static ColorMode colorMode();
+    static void setColorMode(ColorMode mode);
 
   private:
@@ -40,4 +43,5 @@ class KstColorSequence {
     int _count;
     int _ptr;  // pointer to the next color
+    ColorMode _mode;
 };
 




More information about the Kst mailing list