some tweaks in popupPosition()

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=766629
This commit is contained in:
Marco Martin 2008-01-26 12:37:17 +00:00
parent 6b649e560c
commit fb5ad56937

View File

@ -575,7 +575,7 @@ QPoint Widget::popupPosition(const QSize s) const
pos = QPoint(pos.x() - s.width(), pos.y());
break;
default:
if (pos.y() > 0) {
if (pos.y() - s.height() > 0) {
pos = QPoint(pos.x(), pos.y() - s.height());
} else {
pos = QPoint(pos.x(), pos.y() + (int)size().height());
@ -591,6 +591,7 @@ QPoint Widget::popupPosition(const QSize s) const
if (pos.ry() + s.height() > screenRect.height()) {
pos.ry() -= ((pos.ry() + s.height()) - screenRect.height());
}
pos.rx() = qMax(0, pos.rx());
return pos;
}