[Kst] extragear/graphics/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Thu Dec 1 02:09:06 CET 2005


SVN commit 484487 by netterfield:

Activate font selection in viewlabeldialog.



 M  +13 -14    kstviewlabel.cpp  
 M  +0 -5      kstviewlabel.h  


--- trunk/extragear/graphics/kst/kst/kstviewlabel.cpp #484486:484487
@@ -34,6 +34,8 @@
 #include <knuminput.h>
 #include <kcombobox.h>
 #include <kcolorbutton.h>
+#include <kdualcolorbutton.h>
+#include <kfontcombo.h>
 
 #include <qapplication.h>
 #include <qbitmap.h>
@@ -60,7 +62,6 @@
   _justify = justify;
   _fontName = KstApp::inst()->defaultFont();
   _fontSize = 0;
-  _fontColor = KstSettings::globalSettings()->foregroundColor;
   _absFontSize = _fontSize+KstSettings::globalSettings()->plotFontSize;
   _layoutActions &= ~(MoveTo | Copy | CopyTo);
   _standardActions |= Delete | Edit;
@@ -152,14 +153,6 @@
   }
 }
 
-void KstViewLabel::setFontColor(QColor color) {
-  _fontColor = color;
-}
-
-QColor KstViewLabel::fontColor() const {
-  return _fontColor;
-}
-
 void KstViewLabel::resize(const QSize& size) {
   KstBorderedViewObject::resize(size);
   if (!_parsed) {
@@ -291,7 +284,7 @@
   p.rotate(_rotation);
 
   QPen pen;
-  pen.setColor(fontColor());
+  pen.setColor(foregroundColor());
   p.setPen(pen);
 
   rc.xStart = rc.x;
@@ -610,12 +603,14 @@
     widget->_fontSize->setValue(int(fontSize()));
     widget->_horizontal->setCurrentItem(horizJustifyWrap());
     widget->_vertical->setCurrentItem(vertJustifyWrap());
-    widget->_fontColor->setColor(fontColor());
+    widget->_fontColor->setColor(foregroundColor());
+    widget->_font->setCurrentFont(fontName());
 
     widget->_transparent->setChecked(transparent());
     widget->_autoResize->setChecked(autoResize());
     widget->_border->setValue(borderWidth());
-
+    widget->_boxColors->setForeground(borderColor());
+    widget->_boxColors->setBackground(backgroundColor());
   }
   return true;
 }
@@ -625,7 +620,7 @@
   if (!w) {
     return false;
   }
-  
+
   // Replace tabs and newlines in text edit box with \n and \t 
   QRegExp cr("\n");
   QRegExp tab("\t");
@@ -638,10 +633,14 @@
   setFontSize(widget->_fontSize->value());
   setHorizJustifyWrap(widget->_horizontal->currentItem());
   setVertJustifyWrap(widget->_vertical->currentItem());
-  setFontColor(widget->_fontColor->color());
+  setForegroundColor(widget->_fontColor->color());
+  setFontName(widget->_font->currentFont());
+
   setTransparent(widget->_transparent->isChecked());
   setAutoResize(widget->_autoResize->isChecked());
   setBorderWidth(widget->_border->value());
+  setBorderColor(widget->_boxColors->foreground());
+  setBackgroundColor(widget->_boxColors->background());
   
   reparse(); // calls setDirty()
   return true;
--- trunk/extragear/graphics/kst/kst/kstviewlabel.h #484486:484487
@@ -33,7 +33,6 @@
   Q_PROPERTY(QString font READ fontName WRITE setFontName)
   Q_PROPERTY(int dataPrecision READ dataPrecision WRITE setDataPrecision)
   Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize)
-  Q_PROPERTY(QColor fontColor READ fontColor WRITE setFontColor)
   Q_PROPERTY(bool transparent READ transparent WRITE setTransparent)
   Q_PROPERTY(int horizontalJustification READ horizJustifyWrap WRITE setHorizJustifyWrap)
   Q_PROPERTY(int verticalJustification READ vertJustifyWrap WRITE setVertJustifyWrap)
@@ -75,9 +74,6 @@
     void setFontSize(int size);
     int fontSize() const;
 
-    void setFontColor(QColor color);
-    QColor fontColor() const;
-
     virtual void save(QTextStream& ts, const QString& indent = QString::null);
 
     void setDoScalarReplacement(bool in_do);
@@ -125,7 +121,6 @@
     bool _autoResize : 1;
     int _absFontSize; // points
     int _fontSize; // size relative to reference size.....
-    QColor _fontColor;
     int _dataPrecision : 6;
     int _textWidth, _textHeight, _ascent;
     KstLJustifyType _justify;


More information about the Kst mailing list