summaryrefslogtreecommitdiff
path: root/src/tabbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r--src/tabbar.cpp67
1 files changed, 37 insertions, 30 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index 815a153d..94f2c274 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"
@@ -164,18 +165,18 @@ void TabBar::contextMenuRequested(const QPoint &position)
{
m_actualIndex = index;
- menu.addAction(KIcon("tab-duplicate"), i18n("Clone Tab"), this, SLOT(cloneTab()));
+ menu.addAction( mainWindow->actionByName("clone_tab") );
menu.addSeparator();
- menu.addAction(KIcon("tab-close"), i18n("&Close Tab"), this, SLOT(closeTab()));
- menu.addAction(KIcon("tab-close-other"), i18n("Close &Other Tabs"), this, SLOT(closeOtherTabs()));
+ menu.addAction( mainWindow->actionByName("close_tab") );
+ menu.addAction( mainWindow->actionByName("close_other_tabs") );
menu.addSeparator();
- menu.addAction(KIcon("view-refresh"), i18n("Reload Tab"), this, SLOT(reloadTab()));
+ menu.addAction( mainWindow->actionByName("reload_tab") );
}
else
{
menu.addSeparator();
}
- menu.addAction(i18n("Reload All Tabs"), this, SIGNAL(reloadAllTabs()));
+ menu.addAction( mainWindow->actionByName("reload_all_tabs") );
menu.exec(QCursor::pos());
}
@@ -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);
}