From e04ec8601f3771aa7ce98d9d1de34e332f26c103 Mon Sep 17 00:00:00 2001 From: Alex Miranda Date: Sun, 13 Oct 2019 16:37:00 +0200 Subject: Add actions for switching to a specific tab Summary: Add actions to switch to each of the first 9 tabs and another action to switch to the last tab. This feature makes it much easier to quickly switch between tabs just like you normally would be able to when using a web browser or other applications. Reviewers: #vdg, #dolphin, ngraham, elvisangelaccio Reviewed By: #vdg, #dolphin, ngraham Subscribers: meven, ngraham, elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24353 --- src/dolphintabwidget.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/dolphintabwidget.cpp') diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index ec0c783bc..0408d7ed4 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -266,6 +266,18 @@ void DolphinTabWidget::closeTab(const int index) tabPage->deleteLater(); } +void DolphinTabWidget::activateTab(const int index) +{ + if (index < count()) { + setCurrentIndex(index); + } +} + +void DolphinTabWidget::activateLastTab() +{ + setCurrentIndex(count() - 1); +} + void DolphinTabWidget::activateNextTab() { const int index = currentIndex() + 1; -- cgit v1.3