[Kst] branches/work/kst/1.1/kst/kst

George Staikos staikos at kde.org
Sun May 22 21:28:38 CEST 2005


SVN commit 417086 by staikos:

backport first part of fix for 106086


 M  +1 -0      branches/work/kst/1.1/kst/kst/kst2dplot.cpp  
 M  +2 -2      branches/work/kst/1.1/kst/kst/kstiface_impl.cpp  
 M  +1 -1      branches/work/kst/1.1/kst/kst/ksttoplevelview.cpp  
 M  +28 -2     branches/work/kst/1.1/kst/kst/kstviewobject.cpp  
 M  +2 -1      branches/work/kst/1.1/kst/kst/kstviewobject.h  


--- branches/work/kst/1.1/kst/kst/kst2dplot.cpp #417085:417086
@@ -2291,6 +2291,7 @@
   }
 
   // only attempt to draw if plot is big enough
+  kdDebug () << tagName() << ": x_px = " << x_px << " xright_bdr_px = " << xright_bdr_px << " xleft_bdr_px = " << xleft_bdr_px << " y_px = " << y_px << " ybot_bdr_px = " << ybot_bdr_px << " ytop_bdr_px = " << ytop_bdr_px << endl;
   if (x_px - xright_bdr_px - xleft_bdr_px >= 10.0 &&
       y_px - ybot_bdr_px - ytop_bdr_px + 1.0 - ytop_bdr_px >= 10.0) {
     Lx = RelPlotRegion.left();
--- branches/work/kst/1.1/kst/kst/kstiface_impl.cpp #417085:417086
@@ -1059,7 +1059,7 @@
       Kst2DPlotList::Iterator plot_iter = plotlist.findTag(plotName);
       if (plot_iter != plotlist.end()) {
         app->deleteIterator(iter);
-        (*plot_iter)->zoom(true);
+        (*plot_iter)->setMaximized(true);
         return true;
       }
     }
@@ -1080,7 +1080,7 @@
       Kst2DPlotList::Iterator plot_iter = plotlist.findTag(plotName);
       if (plot_iter != plotlist.end()) {
         app->deleteIterator(iter);
-        (*plot_iter)->zoom(false);
+        (*plot_iter)->setMaximized(false);
         return true;
       }
     }
--- branches/work/kst/1.1/kst/kst/ksttoplevelview.cpp #417085:417086
@@ -203,7 +203,7 @@
     clearFocus();
     paint(P_PAINT);
   } else if (_mode == DisplayMode && v != DisplayMode) {
-    recursively<bool>(&KstViewObject::zoom, false);
+    recursively<bool>(&KstViewObject::setMaximized, false);
   }
 
   _mode = v;
--- branches/work/kst/1.1/kst/kst/kstviewobject.cpp #417085:417086
@@ -299,6 +299,13 @@
 void KstViewObject::appendChild(KstViewObjectPtr obj, bool keepAspect) {
   obj->_parent = this;
   _children.append(obj);
+
+  for (KstViewObjectList::Iterator i = children().begin(); i != children().end(); ++i) {
+    if ((*i)->maximized()) {
+      (*i)->setMaximized(false);
+    }
+  }
+
   if (keepAspect) {
     obj->updateFromAspect();
   } else {
@@ -310,6 +317,13 @@
 void KstViewObject::prependChild(KstViewObjectPtr obj, bool keepAspect) {
   obj->_parent = this;
   _children.prepend(obj);
+
+  for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+    if ((*i)->maximized()) {
+      (*i)->setMaximized(false);
+    }
+  }
+
   if (keepAspect) {
     obj->updateFromAspect();
   } else {
@@ -339,6 +353,13 @@
     _children.prepend(obj);
   }
   obj->_parent = this;
+
+  for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+    if ((*i)->maximized()) {
+      (*i)->setMaximized(false);
+    }
+  }
+
   if (keepAspect) {
     obj->updateFromAspect();
   } else {
@@ -1043,8 +1064,13 @@
 }
 
 
-void KstViewObject::zoom(bool zoom) {
-  if (_maximized != zoom) {
+bool KstViewObject::maximized() const {
+  return _maximized;
+}
+
+
+void KstViewObject::setMaximized(bool maximized) {
+  if (_maximized != maximized) {
     zoomToggle();
   }
 }
--- branches/work/kst/1.1/kst/kst/kstviewobject.h #417085:417086
@@ -149,7 +149,8 @@
     virtual void drawFocusRect(QPainter& p);
     virtual void drawSelectRect(QPainter& p);
 
-    virtual void zoom(bool zoom);
+    virtual void setMaximized(bool maximized);
+    bool maximized() const;
     virtual bool isSelected() const;
     virtual void setSelected(bool selected);
     void selectAll();


More information about the Kst mailing list