mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
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
This commit is contained in:
parent
399309d36c
commit
1165a1bc52
|
@ -15,6 +15,7 @@
|
||||||
#include <KIO/CommandLauncherJob>
|
#include <KIO/CommandLauncherJob>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KShell>
|
#include <KShell>
|
||||||
|
#include <KStringHandler>
|
||||||
#include <kio/global.h>
|
#include <kio/global.h>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
@ -507,7 +508,7 @@ QString DolphinTabWidget::tabName(DolphinTabPage *tabPage) const
|
||||||
|
|
||||||
// Make sure that a '&' inside the directory name is displayed correctly
|
// Make sure that a '&' inside the directory name is displayed correctly
|
||||||
// and not misinterpreted as a keyboard shortcut in QTabBar::setTabText()
|
// 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
|
DolphinViewContainer *DolphinTabWidget::viewContainerAt(DolphinTabWidget::ViewIndex viewIndex) const
|
||||||
|
|
Loading…
Reference in a new issue