Skip to content

Commit

Permalink
Implemented #554 - Add a configuration that avoid tab label eliding
Browse files Browse the repository at this point in the history
  • Loading branch information
githubuser0xFFFF committed Sep 19, 2023
1 parent 3c941a2 commit 62d2dd2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions doc/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- [`FloatingContainerForceNativeTitleBar` (Linux only)](#floatingcontainerforcenativetitlebar-linux-only)
- [`FloatingContainerForceQWidgetTitleBar` (Linux only)](#floatingcontainerforceqwidgettitlebar-linux-only)
- [`MiddleMouseButtonClosesTab`](#middlemousebuttonclosestab)
- [`DisableTabTextEliding`](#disabletabtexteliding)
- [Auto-Hide Configuration Flags](#auto-hide-configuration-flags)
- [Auto Hide Dock Widgets](#auto-hide-dock-widgets)
- [Pinning Auto-Hide Widgets to a certain border](#pinning-auto-hide-widgets-to-a-certain-border)
Expand Down Expand Up @@ -465,6 +466,10 @@ under the mouse. So you do not need to exactly hit the tab close button to
close tab. Just click with the middle mouse button on a tab like this is
possible in various web browsers.
### `DisableTabTextEliding`
Set this flag to disable eliding of tab texts in dock area tabs.
![MiddleMouseButtonClosesTab true](cfg_flag_MiddleMouseButtonClosesTab.gif)
## Auto-Hide Configuration Flags
Expand Down
1 change: 1 addition & 0 deletions src/DockManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public Q_SLOTS:
//!< If neither this nor FloatingContainerForceNativeTitleBar is set (the default) native titlebars are used except on known bad systems.
//! Users can overwrite this by setting the environment variable ADS_UseNativeTitle to "1" or "0".
MiddleMouseButtonClosesTab = 0x2000000, //! If the flag is set, the user can use the mouse middle button to close the tab under the mouse
DisableTabTextEliding = 0x4000000, //! Set this flag to disable eliding of tab texts in dock area tabs

DefaultDockAreaButtons = DockAreaHasCloseButton
| DockAreaHasUndockButton
Expand Down
9 changes: 8 additions & 1 deletion src/DockWidgetTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,14 @@ DockWidgetTabPrivate::DockWidgetTabPrivate(CDockWidgetTab* _public) :
void DockWidgetTabPrivate::createLayout()
{
TitleLabel = new tTabLabel();
TitleLabel->setElideMode(Qt::ElideRight);
if (CDockManager::testConfigFlag(CDockManager::DisableTabTextEliding))
{
TitleLabel->setElideMode(Qt::ElideNone);
}
else
{
TitleLabel->setElideMode(Qt::ElideRight);
}
TitleLabel->setText(DockWidget->windowTitle());
TitleLabel->setObjectName("dockWidgetTabLabel");
TitleLabel->setAlignment(Qt::AlignCenter);
Expand Down

0 comments on commit 62d2dd2

Please sign in to comment.