[Kst] [Bug 106086] Adding a plot in Z mode messes leads to meyhem.
George Staikos
staikos at kde.org
Sun May 22 21:07:54 CEST 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=106086
------- Additional Comments From staikos kde org 2005-05-22 21:07 -------
SVN commit 417073 by staikos:
Well, this mostly fixes adding new plots when in maximized mode (and
renames zoom->maximized as we did in public interfaces). Unfortunately
the maximized plot has an invalid top border and I haven't been able to
figure out why yet. Debug output is left there to demonstrate the
problem.
CCBUG: 106086
M +1 -0 trunk/extragear/graphics/kst/kst/kst2dplot.cpp
M +2 -2 trunk/extragear/graphics/kst/kst/kstiface_impl.cpp
M +1 -1 trunk/extragear/graphics/kst/kst/ksttoplevelview.cpp
M +28 -2 trunk/extragear/graphics/kst/kst/kstviewobject.cpp
M +2 -1 trunk/extragear/graphics/kst/kst/kstviewobject.h
--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #417072:417073
@ -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();
--- trunk/extragear/graphics/kst/kst/kstiface_impl.cpp #417072:417073
@ -1061,7 +1061,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;
}
}
@ -1082,7 +1082,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;
}
}
--- trunk/extragear/graphics/kst/kst/ksttoplevelview.cpp #417072:417073
@ -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;
--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #417072:417073
@ -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();
}
}
--- trunk/extragear/graphics/kst/kst/kstviewobject.h #417072:417073
@ -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