From 9329ce25a2e9a25915a5e6d54576d7f91a003096 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 14 Nov 2008 08:04:46 +0000 Subject: [PATCH] handle all corners on load svn path=/trunk/KDE/kdelibs/; revision=884088 --- private/toolbox.cpp | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/private/toolbox.cpp b/private/toolbox.cpp index 3bc53c6f3..4112565f7 100644 --- a/private/toolbox.cpp +++ b/private/toolbox.cpp @@ -336,14 +336,31 @@ void ToolBox::load() d->corner = Corner(group.readEntry("corner", int(d->corner))); int offset = group.readEntry("offset", 0); - if (d->corner == ToolBox::Left) { - setPos(0, offset); - } else if (d->corner == ToolBox::Right) { - setPos(d->containment->size().width() - d->size, offset); - } else if (d->corner == ToolBox::Top) { - setPos(offset, 0); - } else if (d->corner == ToolBox::Bottom) { - setPos(offset, d->containment->size().height() - d->size); + switch (d->corner) { + case ToolBox::TopLeft: + setPos(0, 0); + break; + case ToolBox::Top: + setPos(offset, 0); + 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); + break; + case ToolBox::BottomLeft: + setPos(0, d->containment->size().height() - d->size); + break; + case ToolBox::Left: + setPos(0, offset); + break; } }