don't move the tools more than they need to move; makes it possible to hit the buttons agian!

i see several issues with this method, however, that already existed and will fix that along with implementing save/hide and available space respect later tonight.

svn path=/trunk/KDE/kdelibs/; revision=883080
This commit is contained in:
Aaron J. Seigo 2008-11-12 03:57:01 +00:00
parent ceb8332dae
commit 51c912969b
2 changed files with 9 additions and 9 deletions

View File

@ -289,7 +289,7 @@ void DesktopToolBox::showToolBox()
int y;
switch (corner()) {
case TopRight:
x = (int)boundingRect().left() - maxwidth - iconWidth - 5;
x = (int)boundingRect().right() - maxwidth - iconWidth - 5;
y = (int)boundingRect().top() + 5;
break;
case Top:
@ -305,7 +305,7 @@ void DesktopToolBox::showToolBox()
y = (int)boundingRect().center().y() - iconWidth;
break;
case Right:
x = (int)boundingRect().left() - maxwidth - iconWidth - 5;
x = (int)boundingRect().right() - maxwidth - iconWidth - 5;
y = (int)boundingRect().center().y() - iconWidth;
break;
case BottomLeft:
@ -318,7 +318,7 @@ void DesktopToolBox::showToolBox()
break;
case BottomRight:
default:
x = (int)boundingRect().left() - maxwidth - iconWidth - 5;
x = (int)boundingRect().right() - maxwidth - iconWidth - 5;
y = (int)boundingRect().bottom() - iconWidth - 5;
break;
}

View File

@ -73,22 +73,22 @@ QPoint ToolBox::toolPosition(int toolHeight)
{
switch (d->corner) {
case TopRight:
return QPoint(d->size * 2, -toolHeight);
return QPoint(d->size, -toolHeight);
case Top:
return QPoint((int)boundingRect().center().x() - d->iconSize.width(), -toolHeight);
case TopLeft:
return QPoint(-d->size * 2, -toolHeight);
return QPoint(-d->size, -toolHeight);
case Left:
return QPoint(-d->size * 2, (int)boundingRect().center().y() - d->iconSize.height());
return QPoint(-d->size, (int)boundingRect().center().y() - d->iconSize.height());
case Right:
return QPoint(d->size * 2, (int)boundingRect().center().y() - d->iconSize.height());
return QPoint(d->size, (int)boundingRect().center().y() - d->iconSize.height());
case BottomLeft:
return QPoint(-d->size * 2, toolHeight);
return QPoint(-d->size, toolHeight);
case Bottom:
return QPoint((int)boundingRect().center().x() - d->iconSize.width(), toolHeight);
case BottomRight:
default:
return QPoint(d->size * 2, toolHeight);
return QPoint(d->size, toolHeight);
}
}