diff options
| author | Alex Miranda <[email protected]> | 2019-10-13 16:37:00 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2019-10-13 16:41:00 +0200 |
| commit | e04ec8601f3771aa7ce98d9d1de34e332f26c103 (patch) | |
| tree | f11990490628100944e5d57b00dd0042b51c8098 /src/dolphintabwidget.cpp | |
| parent | e7de9862022a08e1dd9204f0acd6329ac7bf5353 (diff) | |
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
Diffstat (limited to 'src/dolphintabwidget.cpp')
| -rw-r--r-- | src/dolphintabwidget.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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; |
