[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Thu May 20 20:24:45 CEST 2004
CVS commit by arwalker:
Don't actually remove an object from its group when raising and lowering. Instead we go to the lower level.
M +1 -1 ksttoplevelview.cpp 1.46
M +42 -28 kstviewobject.cpp 1.43
M +1 -1 kstviewobject.h 1.40
--- kdeextragear-2/kst/kst/ksttoplevelview.cpp #1.45:1.46
@@ -150,5 +150,5 @@ void KstTopLevelView::setViewMode(ViewMo
clearFocus();
} else if (_mode == DisplayMode && v != DisplayMode) {
- recursively<bool>(&KstViewObject::unzoom, false);
+ recursively<bool>(&KstViewObject::zoom, false);
}
--- kdeextragear-2/kst/kst/kstviewobject.cpp #1.42:1.43
@@ -488,6 +487,8 @@ void KstViewObject::raiseToTop() {
if (_parent) {
KstViewObjectPtr t = this;
- _parent->removeChild(t);
- _parent->appendChild(t);
+ KstViewObjectList::Iterator it = _parent->_children.find(t);
+
+ _parent->_children.remove(it);
+ _parent->_children.append(t);
}
}
@@ -497,6 +498,8 @@ void KstViewObject::lowerToBottom() {
if (_parent) {
KstViewObjectPtr t = this;
- _parent->removeChild(t);
- _parent->prependChild(t);
+ KstViewObjectList::Iterator it = _parent->_children.find(t);
+
+ _parent->_children.remove(it);
+ _parent->_children.prepend(t);
}
}
@@ -506,11 +509,12 @@ void KstViewObject::raise() {
if (_parent) {
KstViewObjectPtr t = this;
- KstViewObjectList::Iterator i = _parent->_children.find(t);
- if (i != _parent->_children.end()) {
- i = _parent->_children.remove(i);
- if (i != _parent->_children.end()) {
- _parent->_children.insert(++i, t);
+ KstViewObjectList::Iterator it = _parent->_children.find(t);
+ if (it != _parent->_children.end()) {
+ it = _parent->_children.remove(it);
+ it++;
+ if (it != _parent->_children.end()) {
+ _parent->_children.insert(it, t);
} else {
- _parent->appendChild(t);
+ _parent->_children.append(t);
}
}
@@ -522,11 +526,12 @@ void KstViewObject::lower() {
if (_parent) {
KstViewObjectPtr t = this;
- KstViewObjectList::Iterator i = _parent->_children.find(t);
- if (i != _parent->_children.end()) {
- i = _parent->_children.remove(i);
- if (!_parent->_children.isEmpty() && i != _parent->_children.begin() && --i != _parent->_children.begin()) {
- _parent->_children.insert(--i, t);
+ KstViewObjectList::Iterator it = _parent->_children.find(t);
+ if (it != _parent->_children.end()) {
+ it = _parent->_children.remove(it);
+ if (!_parent->_children.isEmpty() && it != _parent->_children.begin()) {
+ it--;
+ _parent->_children.insert(it, t);
} else {
- _parent->prependChild(t);
+ _parent->_children.prepend(t);
}
}
@@ -587,9 +592,14 @@ void KstViewObject::setSelected(bool sel
-void KstViewObject::unzoom(bool zoom) {
- if (_bZoomed) {
+void KstViewObject::zoom(bool zoom) {
+ if (_bZoomed && !zoom) {
_bZoomed = false;
_aspect = _aspectOldZoomedObject;
updateFromAspect();
+ } else if (!_bZoomed && zoom) {
+ _bZoomed = true;
+ _aspectOldZoomedObject = _aspect;
+ resizeFromAspect(0.0, 0.0, 1.0, 1.0);
+ raiseToTop();
}
}
@@ -600,16 +610,20 @@ void KstViewObject::zoomToggle() {
_bZoomed = false;
_aspect = _aspectOldZoomedObject;
- updateFromAspect();
- if (_parent) {
- _parent->zoomToggle();
+ if (_parent && _parent->_bZoomed) {
+ _parent->zoom(false);
}
+ updateFromAspect();
} else {
_bZoomed = true;
_aspectOldZoomedObject = _aspect;
+ if (_parent && !_parent->_bZoomed) {
+ _parent->zoom(true);
+ }
resizeFromAspect(0.0, 0.0, 1.0, 1.0);
raiseToTop();
- if (_parent) {
- _parent->zoomToggle();
}
+
+ for (KstViewObjectList::Iterator it = _children.begin(); it != _children.end(); ++it) {
+ (*it)->parentResized();
}
}
--- kdeextragear-2/kst/kst/kstviewobject.h #1.39:1.40
@@ -127,5 +127,5 @@ class KstViewObject : public KstObject {
virtual void drawSelectRect(QPainter& p);
- virtual void unzoom(bool zoom);
+ virtual void zoom(bool zoom);
virtual bool isSelected() const;
virtual void setSelected(bool selected);
More information about the Kst
mailing list