summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-03-07 16:41:08 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-03-07 17:30:55 +0100
commit570dcabcd21c0821f4e55097f2cba5f90e481782 (patch)
treea7884f996ac76152cfca307deebf753f2079a20e
parentrekonq 2.2.1 (diff)
downloadrekonq-570dcabcd21c0821f4e55097f2cba5f90e481782.tar.xz
Respect hovering settings
BUG:316207
-rw-r--r--src/tabwindow/tabbar.cpp10
-rw-r--r--src/tabwindow/tabwindow.cpp16
-rw-r--r--src/tabwindow/tabwindow.h1
-rw-r--r--src/webwindow/webwindow.cpp1
-rw-r--r--src/webwindow/webwindow.h3
5 files changed, 30 insertions, 1 deletions
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 <KAcceleratorManager>
#include <KAction>
#include <KColorScheme>
@@ -43,6 +49,7 @@
#include <KMenu>
#include <KUrl>
+// Qt Includes
#include <QLabel>
#include <QPropertyAnimation>
#include <QSignalMapper>
@@ -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<WebWindow *>(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();
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp
index 55a55e55..864c79b5 100644
--- a/src/webwindow/webwindow.cpp
+++ b/src/webwindow/webwindow.cpp
@@ -124,6 +124,7 @@ WebWindow::WebWindow(QWidget *parent, bool isPrivateBrowsing, WebPage *pg)
// things changed signals
connect(_tab, SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
+ connect(_tab, SIGNAL(urlChanged(QUrl)), this, SIGNAL(urlChanged(QUrl)));
connect(_tab, SIGNAL(iconChanged()), this, SIGNAL(iconChanged()));
// check view signals
diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h
index 590022a7..b2e0f5ae 100644
--- a/src/webwindow/webwindow.h
+++ b/src/webwindow/webwindow.h
@@ -37,6 +37,7 @@
// Qt Includes
#include <QWidget>
#include <QAction>
+#include <QUrl>
// Forward Declarations
class WebPage;
@@ -54,7 +55,6 @@ class KToolBar;
class QLabel;
class QPixmap;
class QTimer;
-class QUrl;
class WebWindow : public QWidget
@@ -147,6 +147,7 @@ private Q_SLOTS:
Q_SIGNALS:
void titleChanged(QString);
+ void urlChanged(QUrl);
void iconChanged();
void loadStarted();