diff options
-rw-r--r-- | src/tabwindow/tabwindow.cpp | 28 | ||||
-rw-r--r-- | src/tabwindow/tabwindow.h | 3 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp index 3910467b..acf84948 100644 --- a/src/tabwindow/tabwindow.cpp +++ b/src/tabwindow/tabwindow.cpp @@ -154,6 +154,16 @@ void TabWindow::init() actionCollection()->addAction(QL1S("close_tab"), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(closeTab())); + a = new KAction(i18n("Show Next Tab"), this); + a->setShortcuts(QApplication::isRightToLeft() ? KStandardShortcut::tabPrev() : KStandardShortcut::tabNext()); + actionCollection()->addAction(QL1S("show_next_tab"), a); + connect(a, SIGNAL(triggered(bool)), this, SLOT(nextTab())); + + a = new KAction(i18n("Show Previous Tab"), this); + a->setShortcuts(QApplication::isRightToLeft() ? KStandardShortcut::tabNext() : KStandardShortcut::tabPrev()); + actionCollection()->addAction(QL1S("show_prev_tab"), a); + connect(a, SIGNAL(triggered(bool)), this, SLOT(previousTab())); + a = KStandardAction::fullScreen(this, SLOT(setFullScreen(bool)), this, actionCollection()); KShortcut fullScreenShortcut = KStandardShortcut::fullScreen(); fullScreenShortcut.setAlternate(Qt::Key_F11); @@ -722,6 +732,24 @@ void TabWindow::restoreLastClosedTab() } +void TabWindow::nextTab() +{ + int next = currentIndex() + 1; + if (next == count()) + next = 0; + setCurrentIndex(next); +} + + +void TabWindow::previousTab() +{ + int next = currentIndex() - 1; + if (next < 0) + next = count() - 1; + setCurrentIndex(next); +} + + void TabWindow::setFullScreen(bool makeFullScreen) { tabBar()->setVisible(!makeFullScreen); diff --git a/src/tabwindow/tabwindow.h b/src/tabwindow/tabwindow.h index 3a00ac4a..a273d3b1 100644 --- a/src/tabwindow/tabwindow.h +++ b/src/tabwindow/tabwindow.h @@ -111,6 +111,9 @@ private Q_SLOTS: void reloadAllTabs(); void bookmarkAllTabs(); + void nextTab(); + void previousTab(); + void restoreLastClosedTab(); void setFullScreen(bool); |