[Kst] extragear/graphics/kst/src/libkstapp
Duncan Hanson
duncan.hanson at gmail.com
Tue Aug 1 19:42:49 CEST 2006
SVN commit 568594 by dhanson:
CCBUG:131620 add _idealSize to saved session.
M +10 -3 kstviewobject.cpp
--- trunk/extragear/graphics/kst/src/libkstapp/kstviewobject.cpp #568593:568594
@@ -104,6 +104,7 @@
_foregroundColor = viewObject._foregroundColor;
_backgroundColor = viewObject._backgroundColor;
_aspect = viewObject._aspect;
+ _idealSize = viewObject._idealSize;
_standardActions = viewObject._standardActions;
_layoutActions = viewObject._layoutActions;
_maximized = false;
@@ -156,6 +157,9 @@
_aspect.y = el.attribute("y", "0.0").toDouble();
_aspect.w = el.attribute("w", "1.0").toDouble();
_aspect.h = el.attribute("h", "1.0").toDouble();
+ } else if (el.tagName() == "idealsize") {
+ _idealSize.setWidth(el.attribute("w", "1").toInt());
+ _idealSize.setHeight(el.attribute("h", "1").toInt());
}
}
n = n.nextSibling();
@@ -289,6 +293,9 @@
"\" w=\"" << aspect.w <<
"\" h=\"" << aspect.h << "\" />" << endl;
+ ts << indent << "<idealsize w=\"" << _idealSize.width() <<
+ "\" h=\"" << _idealSize.height() <<"\" />" << endl;
+
// save all properties
for (int i = 0; i < metaObject()->numProperties(true); i++) {
ts << indent << "<" << metaObject()->property(i, true)->name() << ">";
@@ -565,7 +572,6 @@
_aspect.x = xc; // restore position.
_aspect.y = yc;
updateFromAspect();
- _idealSize = _geom.size();
for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
(*i)->parentResized();
}
@@ -1453,6 +1459,7 @@
void KstViewObject::updateAspect() {
+ _idealSize = _geom.size();
updateAspectSize();
updateAspectPos();
setDirty();
@@ -1570,7 +1577,7 @@
str << tagName();
str << _geom << _backgroundColor << _foregroundColor;
// _parent should not be sent since it is meaningless in a drag context
- str << _standardActions << _layoutActions << _aspect;
+ str << _standardActions << _layoutActions << _aspect << _idealSize;
str << _children.count();
for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
@@ -1592,7 +1599,7 @@
kstdDebug() << "Decoding " << tagName << " from drag." << endl;
// FIXME: rename objects if they cause a namespace conflict
str >> _geom >> _backgroundColor >> _foregroundColor;
- str >> _standardActions >> _layoutActions >> _aspect;
+ str >> _standardActions >> _layoutActions >> _aspect >> _idealSize;
_children.clear();
uint cc = 0;
More information about the Kst
mailing list