summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-01-07 17:49:24 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-01-07 17:49:24 +0100
commitcb84ae8badcab5bfe095e71cf4c0e33175e60817 (patch)
treeb84bf5b9ea1ef4e8056d69647b286f5a6de0017e /src
parentAdded a visit count parameter to the history. (diff)
downloadrekonq-cb84ae8badcab5bfe095e71cf4c0e33175e60817.tar.xz
This GCI task adds a combobox with different settings to choice when hovering tabs:
* tab preview (default one) * show title as tooltip * show url as tooltip * show nothing Patch by Furkan Uzumcu, reviewed (and merged) by adjam BUG:260343 RB:100282
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp29
-rw-r--r--src/mainview.cpp4
-rw-r--r--src/rekonq.kcfg4
-rw-r--r--src/settings/settings_tabs.ui75
-rw-r--r--src/settings/tabswidget.cpp1
-rw-r--r--src/tabbar.cpp9
-rw-r--r--src/tabbar.h1
7 files changed, 96 insertions, 27 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 41c6e762..466a0a4e 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -528,6 +528,35 @@ void Application::updateConfiguration()
Application::historyManager()->loadSettings();
Application::adblockManager()->loadSettings();
+ // hovering unfocused tabs options
+ switch(ReKonfig::hoveringTabOption())
+ {
+ case 0: // tab previews
+ case 3: // nothing
+ for (int i = 0; i < mainWindow()->mainView()->tabBar()->count(); i++)
+ {
+ mainWindow()->mainView()->tabBar()->setTabToolTip(i, "");
+ }
+ break;
+
+ case 1: // title previews
+ for (int i = 0; i < mainWindow()->mainView()->tabBar()->count(); i++)
+ {
+ mainWindow()->mainView()->tabBar()->setTabToolTip(i, mainWindow()->mainView()->tabText(i).remove('&'));
+ }
+ break;
+
+ case 2: // url previews
+ for (int i = 0; i < mainWindow()->mainView()->tabBar()->count(); i++)
+ {
+ mainWindow()->mainView()->tabBar()->setTabToolTip(i, mainWindow()->mainView()->webTab(i)->url().toMimeDataString());
+ }
+ break;
+
+ default: // non extant case
+ break;
+ }
+
defaultSettings = 0;
}
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 94dc1688..42a76758 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -566,6 +566,8 @@ void MainView::webViewTitleChanged(const QString &title)
emit currentTitle(viewTitle);
}
Application::historyManager()->updateHistoryEntry(tab->url(), tabTitle);
+ if (ReKonfig::hoveringTabOption() == 1)
+ tabBar()->setTabToolTip(index, tabTitle.remove('&'));
}
@@ -577,6 +579,8 @@ void MainView::webViewUrlChanged(const QUrl &url)
{
tabBar()->setTabData(index, url);
}
+ if (ReKonfig::hoveringTabOption() == 2)
+ tabBar()->setTabToolTip(index, webTab(index)->url().toMimeDataString());
emit tabsChanged();
}
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index 6700b4e1..cda76d88 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -96,8 +96,8 @@
<entry name="openTabsNearCurrent" type="Bool">
<default>false</default>
</entry>
- <entry name="alwaysShowTabPreviews" type="Bool">
- <default>true</default>
+ <entry name="hoveringTabOption" type="Int">
+ <default>0</default>
</entry>
<entry name="closeTabSelectPrevious" type="Bool">
<default>false</default>
diff --git a/src/settings/settings_tabs.ui b/src/settings/settings_tabs.ui
index 2e2ee103..290c6274 100644
--- a/src/settings/settings_tabs.ui
+++ b/src/settings/settings_tabs.ui
@@ -20,6 +20,9 @@
<string>New Tab Behavior</string>
</property>
<layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="minimumSize">
@@ -126,18 +129,64 @@
<property name="title">
<string>Tabbed Browsing</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_4">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
- <widget class="QCheckBox" name="kcfg_openTabNoWindow">
- <property name="text">
- <string>Open links in new tab instead of in new window</string>
- </property>
- </widget>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label_6">
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>When hovering tab show:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KComboBox" name="kcfg_hoveringTabOption">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <item>
+ <property name="text">
+ <string>Tab Previews</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Title Tooltip</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Url Tooltip</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string comment="@item:inlistbox">Nothing</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
</item>
<item>
- <widget class="QCheckBox" name="kcfg_alwaysShowTabBar">
+ <widget class="QCheckBox" name="kcfg_openTabNoWindow">
<property name="text">
- <string>Always show tab bar</string>
+ <string>Open links in new tab instead of in new window</string>
</property>
</widget>
</item>
@@ -156,16 +205,6 @@
</widget>
</item>
<item>
- <widget class="QCheckBox" name="kcfg_alwaysShowTabPreviews">
- <property name="text">
- <string>Show preview when hovering tab</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
<widget class="QCheckBox" name="kcfg_closeTabSelectPrevious">
<property name="text">
<string>Activate previously used tab when closing the current one</string>
diff --git a/src/settings/tabswidget.cpp b/src/settings/tabswidget.cpp
index aa555339..d9b741be 100644
--- a/src/settings/tabswidget.cpp
+++ b/src/settings/tabswidget.cpp
@@ -41,7 +41,6 @@ void TabsWidget::save()
{
}
-
bool TabsWidget::changed()
{
return _changed;
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index 286d7d45..57124979 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -54,7 +54,6 @@
#include <QtGui/QMouseEvent>
#include <QtGui/QToolButton>
-
#define BASE_WIDTH_DIVISOR 4
#define MIN_WIDTH_DIVISOR 8
@@ -220,7 +219,7 @@ void TabBar::mouseMoveEvent(QMouseEvent *event)
KTabBar::mouseMoveEvent(event);
- if (ReKonfig::alwaysShowTabPreviews())
+ if (ReKonfig::hoveringTabOption() == 0)
{
//Find the tab under the mouse
int i = 0;
@@ -262,7 +261,7 @@ void TabBar::mouseMoveEvent(QMouseEvent *event)
void TabBar::leaveEvent(QEvent *event)
{
- if (ReKonfig::alwaysShowTabPreviews())
+ if (ReKonfig::hoveringTabOption() == 0)
{
//if leave tabwidget then hide previous tab preview
if (!m_previewPopup.isNull())
@@ -278,7 +277,7 @@ void TabBar::leaveEvent(QEvent *event)
void TabBar::mousePressEvent(QMouseEvent *event)
{
- if (ReKonfig::alwaysShowTabPreviews())
+ if (ReKonfig::hoveringTabOption() == 0)
{
if (!m_previewPopup.isNull())
{
@@ -355,7 +354,7 @@ void TabBar::mouseReleaseEvent(QMouseEvent *event)
void TabBar::tabRemoved(int /*index*/)
{
- if (ReKonfig::alwaysShowTabPreviews())
+ if (ReKonfig::hoveringTabOption() == 0)
{
if (!m_previewPopup.isNull())
{
diff --git a/src/tabbar.h b/src/tabbar.h
index acd8e2fb..41707865 100644
--- a/src/tabbar.h
+++ b/src/tabbar.h
@@ -90,7 +90,6 @@ private slots:
private:
void setupHistoryActions();
-
friend class MainView;
/**