From: K. Cottonears Date: Thu, 17 Aug 2023 07:22:49 +0000 (+0000) Subject: Set Maximum Tab Width for folders to Tab bar X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/1165a1bc52cdeb2f6538a47c74b34bf283543ba7 Set Maximum Tab Width for folders to Tab bar There is no limit to the width of tabs with the tab bar of the main window. If the directory name is too long, tabs can take up a lot of space and can lead to inconsistent tab widths. To alleviate this, set a maximum tab bar text width of 40 characters for each folder. BUG: 420870 --- diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index 03f09ca86..89dd9feba 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -507,7 +508,7 @@ QString DolphinTabWidget::tabName(DolphinTabPage *tabPage) const // Make sure that a '&' inside the directory name is displayed correctly // and not misinterpreted as a keyboard shortcut in QTabBar::setTabText() - return name.replace('&', QLatin1String("&&")); + return KStringHandler::rsqueeze(name.replace('&', QLatin1String("&&")), 40 /* default maximum visible folder name visible */); } DolphinViewContainer *DolphinTabWidget::viewContainerAt(DolphinTabWidget::ViewIndex viewIndex) const