From 570dcabcd21c0821f4e55097f2cba5f90e481782 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 7 Mar 2013 16:41:08 +0100 Subject: Respect hovering settings BUG:316207 --- src/tabwindow/tabbar.cpp | 10 ++++++++++ src/tabwindow/tabwindow.cpp | 16 ++++++++++++++++ src/tabwindow/tabwindow.h | 1 + 3 files changed, 27 insertions(+) (limited to 'src/tabwindow') diff --git a/src/tabwindow/tabbar.cpp b/src/tabwindow/tabbar.cpp index 09368fef..bdd07573 100644 --- a/src/tabwindow/tabbar.cpp +++ b/src/tabwindow/tabbar.cpp @@ -25,9 +25,14 @@ * ============================================================ */ +// Self Includes #include "tabbar.h" #include "tabbar.moc" +// Auto Includes +#include "rekonq.h" + +// Local Includes #include "tabwindow.h" #include "tabhighlighteffect.h" #include "tabpreviewpopup.h" @@ -36,6 +41,7 @@ #include "iconmanager.h" #include "sessionmanager.h" +// KDE Includes #include #include #include @@ -43,6 +49,7 @@ #include #include +// Qt Includes #include #include #include @@ -374,6 +381,9 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) return; } + if (ReKonfig::hoveringTabOption() != 0) + return; + // Find the tab under the mouse const int tabIndex = tabAt(event->pos()); diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp index 47b3f254..2ade757b 100644 --- a/src/tabwindow/tabwindow.cpp +++ b/src/tabwindow/tabwindow.cpp @@ -275,6 +275,7 @@ WebWindow *TabWindow::prepareNewTab(WebPage *page) WebWindow *tab = new WebWindow(this, _isPrivateBrowsing, page); connect(tab, SIGNAL(titleChanged(QString)), this, SLOT(tabTitleChanged(QString))); + connect(tab, SIGNAL(urlChanged(QUrl)), this, SLOT(tabUrlChanged(QUrl))); connect(tab, SIGNAL(iconChanged()), this, SLOT(tabIconChanged())); connect(tab, SIGNAL(loadStarted()), this, SLOT(tabLoadStarted())); @@ -444,6 +445,21 @@ void TabWindow::tabTitleChanged(const QString &title) { setWindowTitle(tabTitle + QL1S(" - rekonq")); } + + if (ReKonfig::hoveringTabOption() == 1) + tabBar()->setTabToolTip(index, tabTitle.remove('&')); +} + + +void TabWindow::tabUrlChanged(const QUrl &url) +{ + WebWindow *tab = qobject_cast(sender()); + if (!tab) + return; + + int index = indexOf(tab); + if (ReKonfig::hoveringTabOption() == 2) + tabBar()->setTabToolTip(index, url.toString()); } diff --git a/src/tabwindow/tabwindow.h b/src/tabwindow/tabwindow.h index a1e369d9..c72c252b 100644 --- a/src/tabwindow/tabwindow.h +++ b/src/tabwindow/tabwindow.h @@ -95,6 +95,7 @@ private Q_SLOTS: void updateNewTabButtonPosition(); void tabTitleChanged(const QString &); + void tabUrlChanged(const QUrl &); void tabIconChanged(); void tabLoadStarted(); -- cgit v1.2.1