From aab62d76ead2253d8389f2a0814e42ae06070ef3 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 24 Oct 2009 00:14:35 +0200 Subject: popup Lionel's idea. In Italy we say "Capra e Cavoli" :D --- src/mainwindow.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 787ecdce..275f64eb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -961,7 +961,6 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) } // useful values - int windowWidth = width(); 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); @@ -975,21 +974,25 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) // setting the popup 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(windowWidth/3, labelHeight); + m_popup->setFixedSize(0, 0); m_popup->layout()->setAlignment(Qt::AlignTop); m_popup->layout()->setMargin(4); // setting popus in bottom-(left/right) position int x = geometry().x(); + int y; if(m_flickeringZone) { - x = width() - m_popup->width(); - label->setAlignment(Qt::AlignRight); + y = m_view->currentWebView()->mapToGlobal(QPoint(0,0)).y(); } - - int y = m_view->currentWebView()->mapToGlobal(QPoint(0,pageHeight)).y() - labelHeight - scrollbarSize; + else + { + y = m_view->currentWebView()->mapToGlobal(QPoint(0,pageHeight)).y() - labelHeight - scrollbarSize; + } + QPoint p(x,y); m_popup->show(p); -- cgit v1.2.1