summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2009-08-02 16:03:41 +0200
committermegabigbug <megabigbug@arrakis.(none)>2009-08-02 16:03:41 +0200
commit7b90ec4faa6ab0b29f4d1d553884ccc41abc033d (patch)
treed318276e9703678ba265e8d71688fc6d0b907617
parentA great step forward.. (diff)
downloadrekonq-7b90ec4faa6ab0b29f4d1d553884ccc41abc033d.tar.xz
popup max width = window width
fix popups: don't overlap horizontal scrollbar
-rw-r--r--src/mainwindow.cpp10
1 files 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);