diff options
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f079c8b9..796c2bad 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -101,6 +101,7 @@ MainWindow::MainWindow() , m_mainBar( new KToolBar( QString("MainToolBar"), this, Qt::TopToolBarArea, true, false, false) ) , m_bmBar( new KToolBar( QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, false) ) , m_popup( new KPassivePopup(this) ) + , m_hidePopup( new QTimer(this) ) , m_ac( new KActionCollection(this) ) { // enable window size "auto-save" @@ -146,6 +147,7 @@ MainWindow::MainWindow() connect(Application::instance(), SIGNAL(focusChanged(QWidget*,QWidget*)), m_popup, SLOT(hide())); m_popup->setFrameShape(QFrame::NoFrame); m_popup->setLineWidth(0); + connect(m_hidePopup, SIGNAL(timeout()), m_popup, SLOT(hide())); QTimer::singleShot(0, this, SLOT(postLaunch())); } @@ -240,7 +242,7 @@ QSize MainWindow::sizeHint() const } -KActionCollection *MainWindow::actionCollection () const +KActionCollection *MainWindow::actionCollection() const { return m_ac; } @@ -460,7 +462,7 @@ void MainWindow::setupSidePanel() void MainWindow::slotUpdateConfiguration() { // ============== General ================== - mainView()->updateTabBar(); + m_view->updateTabBar(); // =========== Fonts ============== QWebSettings *defaultSettings = QWebSettings::globalSettings(); @@ -951,12 +953,12 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) // deleting popus if empty msgs if(msg.isEmpty()) { - m_popup->hide(); + m_hidePopup->start(250); return; } - QPixmap px; - QString pixPath; + m_hidePopup->stop(); + switch(status) { @@ -976,9 +978,9 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) // setting the popup QLabel *label = new QLabel(msg); - label->setMaximumWidth(width()-2*margin); m_popup->setView(label); QSize labelSize(label->fontMetrics().width(msg)+2*margin, label->fontMetrics().height()+2*margin); + if (labelSize.width() > width()) labelSize.setWidth(width()); m_popup->setFixedSize(labelSize); m_popup->layout()->setAlignment(Qt::AlignTop); m_popup->layout()->setMargin(margin); |