From 6673522da6e3900e0a5ee50e4428384e1f6ae069 Mon Sep 17 00:00:00 2001 From: lionelc Date: Fri, 9 Oct 2009 17:45:16 +0200 Subject: option for "Always show tab previews" --- src/rekonq.kcfg | 3 +++ src/settings_general.ui | 10 +++++++++ src/tabbar.cpp | 57 +++++++++++++++++++++++++++---------------------- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index 0bffa53d..0a63922f 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -44,6 +44,9 @@ false + + true + diff --git a/src/settings_general.ui b/src/settings_general.ui index d12d254f..844a0073 100644 --- a/src/settings_general.ui +++ b/src/settings_general.ui @@ -139,6 +139,16 @@ + + + + Always show tab previews + + + false + + + diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 815a153d..569a59c5 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -32,6 +32,7 @@ #include "tabbar.moc" // Local Includes +#include "rekonq.h" #include "application.h" #include "mainwindow.h" #include "urlbar.h" @@ -265,47 +266,53 @@ void TabBar::showTabPreview(int tab) void TabBar::mouseMoveEvent(QMouseEvent *event) { - //Find the tab under the mouse - int i = 0; - int tab = -1; - while (ipos())) + //Find the tab under the mouse + int i = 0; + int tab = -1; + while (ipos())) + { + tab = i; + } + i++; } - i++; - } - //if found and not the current tab then show tab preview - if (tab != -1 && tab != currentIndex() && m_currentTabPreview != tab) - { - showTabPreview(tab); - m_currentTabPreview = tab; - } + //if found and not the current tab then show tab preview + if (tab != -1 && tab != currentIndex() && m_currentTabPreview != tab) + { + showTabPreview(tab); + m_currentTabPreview = tab; + } - //if current tab or not found then hide previous tab preview - if (tab==currentIndex() || tab==-1) - { - if ( m_previewPopup) + //if current tab or not found then hide previous tab preview + if (tab==currentIndex() || tab==-1) { - m_previewPopup->hide(); + if ( m_previewPopup) + { + m_previewPopup->hide(); + } + m_currentTabPreview = -1; } - m_currentTabPreview = -1; } - + KTabBar::mouseMoveEvent(event); } void TabBar::leaveEvent(QEvent *event) { - //if leave tabwidget then hide previous tab preview - if ( m_previewPopup) + if (ReKonfig::alwaysShowTabPreviews()) { - m_previewPopup->hide(); + //if leave tabwidget then hide previous tab preview + if ( m_previewPopup) + { + m_previewPopup->hide(); + } + m_currentTabPreview = -1; } - m_currentTabPreview = -1; KTabBar::leaveEvent(event); } -- cgit v1.2.1