handle all corners on load

svn path=/trunk/KDE/kdelibs/; revision=884088
This commit is contained in:
Aaron J. Seigo 2008-11-14 08:04:46 +00:00
parent 2fc960f455
commit 9329ce25a2

View File

@ -336,14 +336,31 @@ void ToolBox::load()
d->corner = Corner(group.readEntry("corner", int(d->corner))); d->corner = Corner(group.readEntry("corner", int(d->corner)));
int offset = group.readEntry("offset", 0); int offset = group.readEntry("offset", 0);
if (d->corner == ToolBox::Left) { switch (d->corner) {
setPos(0, offset); case ToolBox::TopLeft:
} else if (d->corner == ToolBox::Right) { setPos(0, 0);
setPos(d->containment->size().width() - d->size, offset); break;
} else if (d->corner == ToolBox::Top) { case ToolBox::Top:
setPos(offset, 0); setPos(offset, 0);
} else if (d->corner == ToolBox::Bottom) { break;
case ToolBox::TopRight:
setPos(d->containment->size().width() - d->size, 0);
break;
case ToolBox::Right:
setPos(d->containment->size().width() - d->size, offset);
break;
case ToolBox::BottomRight:
setPos(d->containment->size().width() - d->size, d->containment->size().height() - d->size);
break;
case ToolBox::Bottom:
setPos(offset, d->containment->size().height() - d->size); setPos(offset, d->containment->size().height() - d->size);
break;
case ToolBox::BottomLeft:
setPos(0, d->containment->size().height() - d->size);
break;
case ToolBox::Left:
setPos(0, offset);
break;
} }
} }