[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Fri Nov 5 18:02:40 CET 2004


CVS commit by arwalker: 

Don't bring the maximized plot to the top of the z-order. Instead check which plots are maximized when painting.

CCMAIL: 92603-done at bugs.kde.org


  M +10 -3     kst.cpp   1.256
  M +38 -15    kstviewobject.cpp   1.98
  M +1 -1      kstviewobject.h   1.81


--- kdeextragear-2/kst/kst/kst.cpp  #1.255:1.256
@@ -1283,7 +1283,14 @@ void KstApp::toggleDataMode() {
 
 void KstApp::toggleMouseMode() {
-  KstTopLevelViewPtr pView = activeView();
+  KMdiIterator<KMdiChildView*> *it = createIterator();
+  if (it) {
+    while (it->currentItem()) {
+      KstViewWindow *pView = dynamic_cast<KstViewWindow*>(it->currentItem());
   if (pView) {
-    pView->setViewMode(LayoutAction->isChecked() ? KstTopLevelView::LayoutMode : KstTopLevelView::DisplayMode);
+        pView->view()->setViewMode(LayoutAction->isChecked() ? KstTopLevelView::LayoutMode : KstTopLevelView::DisplayMode);
+      }
+      it->next();
+    }
+    deleteIterator(it);
   }
 }

--- kdeextragear-2/kst/kst/kstviewobject.cpp  #1.97:1.98
@@ -192,5 +192,18 @@ void KstViewObject::paint(KstPaintType t
   bool hadClipping = p.hasClipping();
   QRegion oldRegion = p.clipRegion();
+  bool maximized = false;
+
+  //
+  // handle the case where we have maximized plots
+  //
+  for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+    if ((*i)->_maximized) {
+      (*i)->paint(type, p);
+      maximized = true;
+      break;
+    }
+  }
 
+  if (!maximized) {
   for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
     // Compute the clip reg - this can't be stored if we want to keep the code
@@ -204,4 +217,8 @@ void KstViewObject::paint(KstPaintType t
     p.setClipRegion(clipRegion);
     (*i)->paint(type, p);
+      if ((*i)->_maximized) {
+        break;
+      }
+    }
   }
 
@@ -564,6 +581,8 @@ KstViewObjectPtr KstViewObject::findChil
 
 KstViewObjectPtr KstViewObject::findChild(const QPoint& pos) {
+  KstViewObjectPtr obj;
+
   if (!_geom.contains(pos) || _children.isEmpty()) {
-    return KstViewObjectPtr();
+    return obj;
   }
 
@@ -571,5 +590,10 @@ KstViewObjectPtr KstViewObject::findChil
   for (--i; ; --i) {
     if (QRect((*i)->position(), (*i)->size()).contains(pos)) {
-      return *i;
+      if (obj == 0L || (*i)->_maximized) {
+        obj = *i;
+        if ((*i)->_maximized) {
+          break;
+        }
+      }
     }
     if (i == _children.begin()) {
@@ -578,5 +602,5 @@ KstViewObjectPtr KstViewObject::findChil
   }
 
-  return KstViewObjectPtr();
+  return obj;
 }
 
@@ -911,5 +935,4 @@ void KstViewObject::zoomToggle() {
     }
     resizeFromAspect(0.0, 0.0, 1.0, 1.0);
-    raiseToTop();
     _prevOnGrid = onGrid();
     setOnGrid(false);





More information about the Kst mailing list