Bug 124556 - Legend not shown in maximized plots
Summary: Legend not shown in maximized plots
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Solaris
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-30 12:44 UTC by Nicolas Brisset
Modified: 2006-03-30 16:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Brisset 2006-03-30 12:44:39 UTC
Version:           1.3.0_devel (using KDE 3.4.0, compiled sources)
Compiler:          gcc version 3.4.3
OS:                SunOS (sun4u) release 5.8

The legend is not shown in maximized plots, even when it is set to be visible.
To reproduce:
1) kst -w gyrodata.dat, load all 3 curves
2) P1->Plot dialog->Appearance tab->Show legend, Apply changes: the legend is shown
3) Mouse over P1, hit "z": the plot is maximized, but the legend is not shown whereas it should be
4) "z": the plot is restored to normal size, and the legend is correctly shown
Comment 1 George Staikos 2006-03-30 16:08:51 UTC
SVN commit 524417 by staikos:

- make maximized objects show their children
- make printing of maximized objects work
BUG: 124556


 M  +15 -5     kstviewobject.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kstviewobject.cpp #524416:524417
@@ -295,11 +295,23 @@
 
 
 void KstViewObject::paint(KstPainter& p, const QRegion& bounds) {
+  bool maximized = false;
   if (p.type() == KstPainter::P_EXPORT || p.type() == KstPainter::P_PRINT) {
-    paintSelf(p, bounds);
+    // handle the case where we have maximized plots
     for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
-      (*i)->paint(p, bounds);
+      if ((*i)->_maximized) {
+        (*i)->paint(p, bounds);
+        maximized = true;
+        break;
+      }
     }
+
+    if (!maximized) {
+      paintSelf(p, bounds);
+      for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+        (*i)->paint(p, bounds);
+      }
+    }
     return;
   }
 
@@ -316,14 +328,12 @@
 #endif
   paintUpdate();
 
-  bool maximized = false;
   bool nullBounds = bounds.isNull();
 
   // handle the case where we have maximized plots
   for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
     if ((*i)->_maximized) {
-      (*i)->updateSelf();
-      (*i)->paintSelf(p, bounds);
+      (*i)->paint(p, bounds);
       maximized = true;
       break;
     }