diff --git a/src/ViewContainer.cpp b/src/ViewContainer.cpp --- a/src/ViewContainer.cpp +++ b/src/ViewContainer.cpp @@ -152,6 +152,8 @@ setCornerWidget( KonsoleSettings::showQuickButtons() ? _newTabButton : nullptr, Qt::TopLeftCorner); setCornerWidget( KonsoleSettings::showQuickButtons() ? _closeTabButton : nullptr, Qt::TopRightCorner); + tabBar()->setExpanding(KonsoleSettings::expandTabWidth()); + tabBar()->update(); if (isVisible() && KonsoleSettings::showQuickButtons()) { _newTabButton->setVisible(true); _closeTabButton->setVisible(true); diff --git a/src/ViewManager.h b/src/ViewManager.h --- a/src/ViewManager.h +++ b/src/ViewManager.h @@ -281,6 +281,9 @@ */ Q_SCRIPTABLE void moveSessionRight(); + /** DBus slot that sets ALL tabs' width to match their text */ + Q_SCRIPTABLE void setTabWidthToText(bool); + private Q_SLOTS: // called when the "Split View Left/Right" menu item is selected void splitLeftRight(); diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -1101,3 +1101,11 @@ { moveActiveViewRight(); } + +void ViewManager::setTabWidthToText(bool setTabWidthToText) +{ + for(auto container : _viewSplitter->containers()) { + container->tabBar()->setExpanding(!setTabWidthToText); + container->tabBar()->update(); + } +}