mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Enable the previous and next tab toolbar buttons
when multiple tabs are opened. Disable them again when there is only one remaining tab. Additionally set the default state to disabled. BUG: 332628 FIXED-IN: 4.13.1 REVIEW: 117778
This commit is contained in:
parent
272cbbd16b
commit
afa1a8ef11
|
@ -481,6 +481,8 @@ void DolphinMainWindow::openNewTab(const KUrl& url)
|
|||
m_viewTab.append(viewTab);
|
||||
|
||||
actionCollection()->action("close_tab")->setEnabled(true);
|
||||
actionCollection()->action("activate_prev_tab")->setEnabled(true);
|
||||
actionCollection()->action("activate_next_tab")->setEnabled(true);
|
||||
|
||||
// Provide a split view, if the startup settings are set this way
|
||||
if (GeneralSettings::splitView()) {
|
||||
|
@ -1155,6 +1157,8 @@ void DolphinMainWindow::closeTab(int index)
|
|||
if (m_viewTab.count() == 1) {
|
||||
m_tabBar->removeTab(0);
|
||||
actionCollection()->action("close_tab")->setEnabled(false);
|
||||
actionCollection()->action("activate_prev_tab")->setEnabled(false);
|
||||
actionCollection()->action("activate_next_tab")->setEnabled(false);
|
||||
} else {
|
||||
m_tabBar->blockSignals(false);
|
||||
}
|
||||
|
@ -1634,11 +1638,13 @@ void DolphinMainWindow::setupActions()
|
|||
|
||||
KAction* activateNextTab = actionCollection()->addAction("activate_next_tab");
|
||||
activateNextTab->setText(i18nc("@action:inmenu", "Activate Next Tab"));
|
||||
activateNextTab->setEnabled(false);
|
||||
connect(activateNextTab, SIGNAL(triggered()), SLOT(activateNextTab()));
|
||||
activateNextTab->setShortcuts(QApplication::isRightToLeft() ? prevTabKeys : nextTabKeys);
|
||||
|
||||
KAction* activatePrevTab = actionCollection()->addAction("activate_prev_tab");
|
||||
activatePrevTab->setText(i18nc("@action:inmenu", "Activate Previous Tab"));
|
||||
activatePrevTab->setEnabled(false);
|
||||
connect(activatePrevTab, SIGNAL(triggered()), SLOT(activatePrevTab()));
|
||||
activatePrevTab->setShortcuts(QApplication::isRightToLeft() ? nextTabKeys : prevTabKeys);
|
||||
|
||||
|
|
Loading…
Reference in a new issue