diff options
| author | Peter Penz <[email protected]> | 2011-06-10 16:26:28 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-06-10 16:27:39 +0200 |
| commit | 8f6045bac7410ac599b2ece0aa045102be492bd2 (patch) | |
| tree | 47aff9516b82d45485d8de47a08a687a503d9e7c | |
| parent | 6d4cfc25d404f5119701504fc8bfae4c7f04ad48 (diff) | |
Fix position of toolbar-menu
CCBUG: 274495
| -rw-r--r-- | src/dolphinmainwindow.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 4c584cdf9..198e2da77 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -2267,20 +2267,18 @@ void ToolBarMenu::showEvent(QShowEvent* event) // Assure that the menu is not shown outside the screen boundaries and // that it does not overlap with the parent button. const QRect screen = QApplication::desktop()->screenGeometry(QCursor::pos()); - if (pos.x() < 0) { - pos.rx() = 0; - } else if (pos.x() + width() >= screen.width()) { - pos.rx() = screen.width() - width(); + if (pos.x() < screen.x()) { + pos.rx() = screen.x(); + } else if (pos.x() + width() > screen.x() + screen.width()) { + pos.rx() = screen.x() + screen.width() - width(); } - if (pos.y() < 0) { - pos.ry() = 0; - } else if (pos.y() + height() >= screen.height()) { + if (pos.y() < screen.y()) { + pos.ry() = screen.y(); + } else if (pos.y() + height() > screen.y() + screen.height()) { pos.ry() = button->mapToGlobal(QPoint(0, 0)).y() - height(); } - pos += screen.topLeft(); - move(pos); } |
