diff options
author | Alexandr Domrachev <alexandr.domrachev@gmail.com> | 2009-04-27 18:01:41 +0000 |
---|---|---|
committer | Alexandr Domrachev <alexandr.domrachev@gmail.com> | 2009-04-27 18:01:41 +0000 |
commit | 78aef384a57bca278bdd4484e9b31bbd7b88c98e (patch) | |
tree | 708e17ee009ec87fd70df78d9be98c4bad5694bd /src/tabbar.cpp | |
parent | Some changes ported for merge to mainline (bookmarks & links handling related) (diff) | |
download | rekonq-78aef384a57bca278bdd4484e9b31bbd7b88c98e.tar.xz |
TabBar code clean. Icons added to context menu
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r-- | src/tabbar.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 75a06e23..6914ef77 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -96,18 +96,20 @@ QSize TabBar::tabSizeHint(int index) const void TabBar::contextMenuRequested(const QPoint &position) { KMenu menu; - menu.addAction(i18n("New &Tab"), this, SIGNAL(newTab())); + MainWindow *mainWindow = Application::instance()->mainWindow(); + + menu.addAction(mainWindow->actionByName(QLatin1String("new_tab"))); int index = tabAt(position); if (-1 != index) { m_actualIndex = index; - KAction *action = (KAction *) menu.addAction(i18n("Clone Tab"), this, SLOT(cloneTab())); + menu.addAction(KIcon("tab-duplicate"), i18n("Clone Tab"), this, SLOT(cloneTab())); menu.addSeparator(); - action = (KAction *) menu.addAction(i18n("&Close Tab"), this, SLOT(closeTab())); - action = (KAction *) menu.addAction(i18n("Close &Other Tabs"), this, SLOT(closeOtherTabs())); + 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.addSeparator(); - action = (KAction *) menu.addAction(i18n("Reload Tab"), this, SLOT(reloadTab())); + menu.addAction(KIcon("view-refresh"), i18n("Reload Tab"), this, SLOT(reloadTab())); } else { @@ -136,16 +138,6 @@ void TabBar::closeOtherTabs() } -void TabBar::mousePressEvent(QMouseEvent *event) -{ - if (event->button() == Qt::LeftButton) - { - m_dragStartPos = event->pos(); - } - KTabBar::mousePressEvent(event); -} - - void TabBar::reloadTab() { emit reloadTab(m_actualIndex); |