[Kst] branches/work/kst/1.5/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Wed Aug 29 21:24:56 CEST 2007


SVN commit 706241 by arwalker:

disable defaults ui for objects that do not support them

 M  +4 -1      kstgfxtextmousehandler.cpp  
 M  +1 -1      kstviewellipse.cpp  
 M  +16 -6     kstviewlabel.cpp  
 M  +1 -0      kstviewlabel.h  
 M  +5 -0      kstviewlegend.cpp  
 M  +1 -0      kstviewlegend.h  


--- branches/work/kst/1.5/kst/src/libkstapp/kstgfxtextmousehandler.cpp #706240:706241
@@ -78,9 +78,10 @@
 
   // once released, create a new text object and popup the edit dialog
   if (!_cancelled) {
+    QSize size(0,0);
     KstViewLabelPtr label = new KstViewLabel;
     copyDefaults(KstViewObjectPtr(label));
-    QSize size(0,0);
+
     if (_mouseOrigin != pos) {
       label->move(_prevBand.topLeft());
       size = _prevBand.size();
@@ -89,6 +90,7 @@
     }
 
     bool wasClick = size == QSize(0, 0);
+
     if (size.width() < 3) {
       size.setWidth(3);
     }
@@ -99,6 +101,7 @@
 
     if (label->showDialog(view, true)) {
       KstViewObjectPtr container;
+
       if (wasClick) {
         container = view->findDeepestChild(pos);
       } else {
--- branches/work/kst/1.5/kst/src/libkstapp/kstviewellipse.cpp #706240:706241
@@ -159,7 +159,7 @@
 
 
 void KstViewEllipse::setForegroundColor(const QColor& color) {
-  KstViewObject::setForegroundColor(color);  
+  KstViewObject::setForegroundColor(color);
 }
 
 
--- branches/work/kst/1.5/kst/src/libkstapp/kstviewlabel.cpp #706240:706241
@@ -106,7 +106,7 @@
     if (!el.isNull()) {
       if (metaObject()->findProperty(el.tagName().latin1(), true) > -1) {
         setProperty(el.tagName().latin1(), QVariant(el.text()));  
-      }  
+      }
     }
     n = n.nextSibling();
   }
@@ -414,12 +414,12 @@
   p.save();
   if (p.type() == KstPainter::P_PRINT || p.type() == KstPainter::P_EXPORT) {
     int absFontSizeOld = _absFontSize;
-    
+
     QRect cr(contentsRectForPainter(p));
     cr.setSize(sizeForText(_parent->geometry()));
     setContentsRectForPainter(p, cr);    
     KstBorderedViewObject::paintSelf(p, bounds);
-    
+
     p.translate(cr.left(), cr.top());
     if (!_transparent) {
       p.fillRect(0, 0, cr.width(), cr.height(), backgroundColor());
@@ -799,6 +799,11 @@
 }
 
 
+bool KstViewLabel::supportsDefaults() {
+  return false;
+}
+
+
 void KstViewLabel::setDataPrecision(int prec) {
   int n;
 
@@ -852,11 +857,11 @@
 
 void KstViewLabel::setHorizJustifyWrap(int justify) {
   Q_UINT8 justifySet;
-  
+
   switch (justify) {
     case 0:
       justifySet = KST_JUSTIFY_H_LEFT;
-      break;  
+      break;
     case 1:
       justifySet = KST_JUSTIFY_H_RIGHT;
       break;
@@ -869,6 +874,7 @@
   setJustification(SET_KST_JUSTIFY(justifySet, KST_JUSTIFY_V(justification())));
 }
 
+
 void KstViewLabel::setLabelMargin(int margin) {
   int mm = kMax(0, margin);
   if (mm != _labelMargin) {
@@ -919,6 +925,7 @@
           }
         }
         break;
+
       case DataRef::DRString:
         {
           KST::stringList.lock().readLock();
@@ -933,6 +940,7 @@
           }
         }
         break;
+
       case DataRef::DRExpression:
         {
           bool ok = false;
@@ -942,6 +950,7 @@
           }
         }
         break;
+
       case DataRef::DRVector:
         {
           bool ok = false;
@@ -962,6 +971,7 @@
           }
         }
         break;
+
       case DataRef::DataRef::DRFit:
         {
           KST::dataObjectList.lock().readLock();
@@ -984,4 +994,4 @@
 }
 
 #include "kstviewlabel.moc"
-// vim: ts=2 sw=2 et
+
--- branches/work/kst/1.5/kst/src/libkstapp/kstviewlabel.h #706240:706241
@@ -100,6 +100,7 @@
     bool readConfigWidget(QWidget *w, bool editMultipleMode);
     void connectConfigWidget(QWidget *parent, QWidget *w) const;
     void populateEditMultiple(QWidget *w);
+    bool supportsDefaults();
 
     KstObject::UpdateType update(int counter);
     void adjustSizeForText(const QRect& w);
--- branches/work/kst/1.5/kst/src/libkstapp/kstviewlegend.cpp #706240:706241
@@ -827,6 +827,11 @@
 }
 
 
+bool KstViewLegend::supportsDefaults() {
+  return false;
+}
+
+
 bool KstViewLegend::vertical() const {
   return _vertical;
 }
--- branches/work/kst/1.5/kst/src/libkstapp/kstviewlegend.h #706240:706241
@@ -82,6 +82,7 @@
     bool readConfigWidget(QWidget *w, bool editMultipleMode);
     void connectConfigWidget(QWidget *parent, QWidget *w) const;
     void populateEditMultiple(QWidget *w);
+    bool supportsDefaults();
 
     void addCurve(KstBaseCurvePtr curve);
     void removeCurve(KstBaseCurvePtr curve);


More information about the Kst mailing list