From 7b90ec4faa6ab0b29f4d1d553884ccc41abc033d Mon Sep 17 00:00:00 2001 From: megabigbug Date: Sun, 2 Aug 2009 16:03:41 +0200 Subject: popup max width = window width fix popups: don't overlap horizontal scrollbar --- src/mainwindow.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 27ed8e37..7f00f201 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -933,16 +933,22 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) m_popup->setFrameShape(QFrame::NoFrame); QLabel *label = new QLabel(msg); + label->setMaximumWidth(width()-8); m_popup->setLineWidth(0); m_popup->setView(label); m_popup->setFixedSize(0, 0); m_popup->layout()->setAlignment(Qt::AlignTop); m_popup->layout()->setMargin(4); - int h = KGlobalSettings::generalFont().pointSize(); // setting popus in bottom-left position + int pageHeight = m_view->currentWebView()->page()->viewportSize().height(); + int labelHeight = KGlobalSettings::generalFont().pointSize()*2 + 7; + bool scrollbarIsVisible = m_view->currentWebView()->page()->currentFrame()->scrollBarMaximum(Qt::Horizontal); + int scrollbarSize = 0; + if (scrollbarIsVisible) scrollbarSize = 17; //TODO: detect QStyle size + int x = geometry().x(); - int y = geometry().y() + height() - h*3; + int y = m_view->currentWebView()->mapToGlobal(QPoint(0,pageHeight)).y() - labelHeight -scrollbarSize; QPoint p(x,y); m_popup->show(p); -- cgit v1.2.1