┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphintabwidget.cpp
diff options
context:
space:
mode:
authorK. Cottonears <[email protected]>2023-08-17 07:22:49 +0000
committerMéven Car <[email protected]>2023-08-17 07:22:49 +0000
commit1165a1bc52cdeb2f6538a47c74b34bf283543ba7 (patch)
tree98a0f16121916c2e02fc3113cf0a6f8b1debf6f7 /src/dolphintabwidget.cpp
parent399309d36c3291bbcfd2d7b09314ae3049608705 (diff)
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
Diffstat (limited to 'src/dolphintabwidget.cpp')
-rw-r--r--src/dolphintabwidget.cpp3
1 files changed, 2 insertions, 1 deletions
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 <KIO/CommandLauncherJob>
#include <KLocalizedString>
#include <KShell>
+#include <KStringHandler>
#include <kio/global.h>
#include <QApplication>
@@ -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