diff --git a/src/ViewContainer.cpp b/src/ViewContainer.cpp --- a/src/ViewContainer.cpp +++ b/src/ViewContainer.cpp @@ -70,7 +70,7 @@ setMovable(true); connect(tabBarWidget, &DetachableTabBar::moveTabToWindow, this, &TabbedViewContainer::moveTabToWindow); tabBar()->setContextMenuPolicy(Qt::CustomContextMenu); - _newTabButton->setIcon(QIcon::fromTheme(QStringLiteral("document-new"))); + _newTabButton->setIcon(QIcon::fromTheme(QStringLiteral("tab-new"))); _newTabButton->setAutoRaise(true); connect(_newTabButton, &QToolButton::clicked, this, [this]{ emit newViewRequest(this); @@ -103,6 +103,8 @@ } }); + connect(tabBar(), &QTabBar::tabCloseRequested, this, &TabbedViewContainer::closeTerminalTab); + #if defined(ENABLE_DETACHING) auto detachAction = _contextPopupMenu->addAction( QIcon::fromTheme(QStringLiteral("tab-detach")), @@ -188,15 +190,16 @@ setTabPosition((QTabWidget::TabPosition) KonsoleSettings::tabBarPosition()); - setCornerWidget( KonsoleSettings::showQuickButtons() ? _newTabButton : nullptr, Qt::TopLeftCorner); - setCornerWidget( KonsoleSettings::showQuickButtons() ? _closeTabButton : nullptr, Qt::TopRightCorner); + setCornerWidget(KonsoleSettings::newTabButton() ? _newTabButton : nullptr, Qt::TopLeftCorner); + _newTabButton->setVisible(KonsoleSettings::newTabButton()); + + setCornerWidget(KonsoleSettings::closeTabButton() == 1 ? _closeTabButton : nullptr, Qt::TopRightCorner); + _closeTabButton->setVisible(KonsoleSettings::closeTabButton() == 1); + + tabBar()->setTabsClosable(KonsoleSettings::closeTabButton() == 0); tabBar()->setExpanding(KonsoleSettings::expandTabWidth()); tabBar()->update(); - if (isVisible() && KonsoleSettings::showQuickButtons()) { - _newTabButton->setVisible(true); - _closeTabButton->setVisible(true); - } if (KonsoleSettings::tabBarUseUserStyleSheet()) { setCssFromFile(KonsoleSettings::tabBarUserStyleSheetFile()); diff --git a/src/settings/TabBarSettings.ui b/src/settings/TabBarSettings.ui --- a/src/settings/TabBarSettings.ui +++ b/src/settings/TabBarSettings.ui @@ -17,6 +17,30 @@ Appearance + + + + Use user-defined stylesheet + + + + + + + Tab bar visibility: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Expand Individual Tab Widths to Full Window + + + @@ -27,6 +51,26 @@ + + + + + 1 + 0 + + + + + Above Terminal Area + + + + + Below Terminal Area + + + + @@ -52,24 +96,7 @@ - - - - Tab bar visibility: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Expand Individual Tab Widths to Full Window - - - - + @@ -82,56 +109,64 @@ - - + + + + QFrame::Box + + + QFrame::Plain + - Show 'New Tab' and 'Close Tab' buttons + Starting with Qt 5.9, the next two options have different effects. + + + Qt::AlignCenter + + + true - - + + - Use user-defined stylesheet + Close Tab button: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + 1 0 - Above Terminal Area + On each tab - Below Terminal Area + On the tab bar + + + + + None - - - QFrame::Box - - - QFrame::Plain - + - Starting with Qt 5.9, the next two options have different effects. - - - Qt::AlignCenter - - - true + Show 'New Tab' button diff --git a/src/settings/konsole.kcfg b/src/settings/konsole.kcfg --- a/src/settings/konsole.kcfg +++ b/src/settings/konsole.kcfg @@ -87,10 +87,19 @@ - - + + false + + + + + + + + OnEachTab +