diff options
author | lionelc <lionelc@lionelc.(none)> | 2009-10-09 17:45:16 +0200 |
---|---|---|
committer | lionelc <lionelc@lionelc.(none)> | 2009-10-09 17:45:16 +0200 |
commit | 6673522da6e3900e0a5ee50e4428384e1f6ae069 (patch) | |
tree | 9e4423d7b4d4d4dde679b009962cc7480af55403 /src | |
parent | HUGE COMMIT (diff) | |
download | rekonq-6673522da6e3900e0a5ee50e4428384e1f6ae069.tar.xz |
option for "Always show tab previews"
Diffstat (limited to 'src')
-rw-r--r-- | src/rekonq.kcfg | 3 | ||||
-rw-r--r-- | src/settings_general.ui | 10 | ||||
-rw-r--r-- | 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 @@ <entry name="openTabsNearCurrent" type="Bool"> <default>false</default> </entry> + <entry name="alwaysShowTabPreviews" type="Bool"> + <default>true</default> + </entry> </group> <!-- Fonts Settings --> 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 @@ </property> </widget> </item> + <item> + <widget class="QCheckBox" name="kcfg_alwaysShowTabPreviews"> + <property name="text"> + <string>Always show tab previews</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </item> </layout> </widget> </item> 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 (i<count() && tab==-1) + if (ReKonfig::alwaysShowTabPreviews()) { - if (tabRect(i).contains(event->pos())) + //Find the tab under the mouse + int i = 0; + int tab = -1; + while (i<count() && tab==-1) { - tab = i; + if (tabRect(i).contains(event->pos())) + { + 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); } |