ok, second try based on tzander's response. i think this should work better and be a nice come back from lunch toy for him to play/test with.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=773999
This commit is contained in:
parent
5b394a752f
commit
e27b0ca4d0
@ -553,9 +553,6 @@ QPoint Widget::popupPosition(const QSize s) const
|
||||
loc = pv->containment()->location();
|
||||
}
|
||||
|
||||
QRect screenRect = QApplication::desktop()->screenGeometry(pv ? pv->containment()->screen() : -1);
|
||||
pos += screenRect.topLeft();
|
||||
|
||||
switch (loc) {
|
||||
case BottomEdge:
|
||||
pos = QPoint(pos.x(), pos.y() - s.height());
|
||||
@ -579,9 +576,12 @@ QPoint Widget::popupPosition(const QSize s) const
|
||||
|
||||
//are we out of screen?
|
||||
|
||||
QRect screenRect = QApplication::desktop()->screenGeometry(pv ? pv->containment()->screen() : -1);
|
||||
|
||||
if (pos.rx() + s.width() > screenRect.right()) {
|
||||
pos.rx() -= ((pos.rx() + s.width()) - screenRect.right());
|
||||
}
|
||||
|
||||
if (pos.ry() + s.height() > screenRect.bottom()) {
|
||||
pos.ry() -= ((pos.ry() + s.height()) - screenRect.bottom());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user