From 2d2f198846f32e727663da979f6f1337ba06b433 Mon Sep 17 00:00:00 2001 From: nowrep Date: Thu, 9 Jan 2014 10:22:06 +0100 Subject: [PATCH] [TabBar] Show tooltips on tabs when tab previews are disabled --- src/lib/webview/tabbar.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/webview/tabbar.cpp b/src/lib/webview/tabbar.cpp index 3a5082868..c5460cd1e 100644 --- a/src/lib/webview/tabbar.cpp +++ b/src/lib/webview/tabbar.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2013 David Rosca +* Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ #include #include #include -#include +#include TabBar::TabBar(QupZilla* mainClass, TabWidget* tabWidget) : ComboTabBar() @@ -659,6 +659,17 @@ void TabBar::mouseReleaseEvent(QMouseEvent* event) bool TabBar::event(QEvent* event) { switch (event->type()) { + case QEvent::ToolTip: + if (!m_showTabPreviews) { + QHelpEvent *ev = static_cast(event); + int index = tabAt(ev->pos()); + + if (index >= 0) { + QToolTip::showText(mapToGlobal(ev->pos()), tabToolTip(index)); + } + } + break; + case QEvent::Leave: if (!rect().contains(mapFromGlobal(QCursor::pos()))) { hideTabPreview();