[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Tue Apr 6 08:24:19 CEST 2004
CVS commit by staikos:
fix size coordinates
M +6 -5 kstviewobject.cpp 1.8
--- kdeextragear-2/kst/kst/kstviewobject.cpp #1.7:1.8
@@ -124,5 +124,5 @@ const KstViewObjectList& KstViewObject::
void KstViewObject::resize(const QSize& size) {
- kdDebug() << "Resizing [" << tagName() << "]" << endl;
+ kdDebug() << "Resizing [" << tagName() << "] " << size << endl;
_size = size;
for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
@@ -141,4 +141,5 @@ void KstViewObject::parentResized(const
QSize newSize = _size;
+ // Completely broken!! FIXME
if (_pos.x() > size.width() - 1) {
_pos.setX(size.width() - 1);
@@ -196,7 +197,7 @@ void KstViewObject::cleanup(int cols) {
int w = _size.width() / cols;
int lastRow = _children.count() / cols;
- int h = _size.height() / lastRow;
+ int h = _size.height() / (lastRow + (_children.count() % cols > 0 ? 1 : 0));
- for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i, ++pos) {
+ for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
QSize sz(w, h);
QPoint pt(x, y);
@@ -207,5 +208,5 @@ void KstViewObject::cleanup(int cols) {
// Adjust the last row to be sure that we don't spill over
- if ((pos + 1) / cols == lastRow) {
+ if ((pos + 1) / cols > lastRow) {
sz.setHeight(_size.height() - y);
}
@@ -214,5 +215,5 @@ void KstViewObject::cleanup(int cols) {
(*i)->resize(sz);
- if (pos % cols == 0) {
+ if (++pos % cols == 0) {
x = 0;
y -= h;
More information about the Kst
mailing list