Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System
This commit is contained in:
BIN
doc/cfg_flag_TabsAtBottom.png
Normal file
BIN
doc/cfg_flag_TabsAtBottom.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -1,79 +1,81 @@
|
|||||||
# User Guide
|
# User Guide
|
||||||
|
|
||||||
- [Configuration Flags](#configuration-flags)
|
- [User Guide](#user-guide)
|
||||||
- [Setting Configuration Flags](#setting-configuration-flags)
|
- [Configuration Flags](#configuration-flags)
|
||||||
- [`ActiveTabHasCloseButton`](#activetabhasclosebutton)
|
- [Setting Configuration Flags](#setting-configuration-flags)
|
||||||
- [`DockAreaHasCloseButton`](#dockareahasclosebutton)
|
- [`ActiveTabHasCloseButton`](#activetabhasclosebutton)
|
||||||
- [`DockAreaCloseButtonClosesTab`](#dockareaclosebuttonclosestab)
|
- [`DockAreaHasCloseButton`](#dockareahasclosebutton)
|
||||||
- [`OpaqueSplitterResize`](#opaquesplitterresize)
|
- [`DockAreaCloseButtonClosesTab`](#dockareaclosebuttonclosestab)
|
||||||
- [`XmlAutoFormattingEnabled`](#xmlautoformattingenabled)
|
- [`OpaqueSplitterResize`](#opaquesplitterresize)
|
||||||
- [`XmlCompressionEnabled`](#xmlcompressionenabled)
|
- [`XmlAutoFormattingEnabled`](#xmlautoformattingenabled)
|
||||||
- [`TabCloseButtonIsToolButton`](#tabclosebuttonistoolbutton)
|
- [`XmlCompressionEnabled`](#xmlcompressionenabled)
|
||||||
- [`AllTabsHaveCloseButton`](#alltabshaveclosebutton)
|
- [`TabCloseButtonIsToolButton`](#tabclosebuttonistoolbutton)
|
||||||
- [`RetainTabSizeWhenCloseButtonHidden`](#retaintabsizewhenclosebuttonhidden)
|
- [`AllTabsHaveCloseButton`](#alltabshaveclosebutton)
|
||||||
- [`DragPreviewIsDynamic`](#dragpreviewisdynamic)
|
- [`RetainTabSizeWhenCloseButtonHidden`](#retaintabsizewhenclosebuttonhidden)
|
||||||
- [`DragPreviewShowsContentPixmap`](#dragpreviewshowscontentpixmap)
|
- [`DragPreviewIsDynamic`](#dragpreviewisdynamic)
|
||||||
- [`DragPreviewHasWindowFrame`](#dragpreviewhaswindowframe)
|
- [`DragPreviewShowsContentPixmap`](#dragpreviewshowscontentpixmap)
|
||||||
- [`AlwaysShowTabs`](#alwaysshowtabs)
|
- [`DragPreviewHasWindowFrame`](#dragpreviewhaswindowframe)
|
||||||
- [`DockAreaHasUndockButton`](#dockareahasundockbutton)
|
- [`AlwaysShowTabs`](#alwaysshowtabs)
|
||||||
- [`DockAreaHasTabsMenuButton`](#dockareahastabsmenubutton)
|
- [`DockAreaHasUndockButton`](#dockareahasundockbutton)
|
||||||
- [`DockAreaHideDisabledButtons`](#dockareahidedisabledbuttons)
|
- [`DockAreaHasTabsMenuButton`](#dockareahastabsmenubutton)
|
||||||
- [`DockAreaDynamicTabsMenuButtonVisibility`](#dockareadynamictabsmenubuttonvisibility)
|
- [`DockAreaHideDisabledButtons`](#dockareahidedisabledbuttons)
|
||||||
- [`FloatingContainerHasWidgetTitle`](#floatingcontainerhaswidgettitle)
|
- [`DockAreaDynamicTabsMenuButtonVisibility`](#dockareadynamictabsmenubuttonvisibility)
|
||||||
- [`FloatingContainerHasWidgetIcon`](#floatingcontainerhaswidgeticon)
|
- [`FloatingContainerHasWidgetTitle`](#floatingcontainerhaswidgettitle)
|
||||||
- [`HideSingleCentralWidgetTitleBar`](#hidesinglecentralwidgettitlebar)
|
- [`FloatingContainerHasWidgetIcon`](#floatingcontainerhaswidgeticon)
|
||||||
- [`FocusHighlighting`](#focushighlighting)
|
- [`HideSingleCentralWidgetTitleBar`](#hidesinglecentralwidgettitlebar)
|
||||||
- [`EqualSplitOnInsertion`](#equalsplitoninsertion)
|
- [`FocusHighlighting`](#focushighlighting)
|
||||||
- [`FloatingContainerForceNativeTitleBar` (Linux only)](#floatingcontainerforcenativetitlebar-linux-only)
|
- [`EqualSplitOnInsertion`](#equalsplitoninsertion)
|
||||||
- [`FloatingContainerForceQWidgetTitleBar` (Linux only)](#floatingcontainerforceqwidgettitlebar-linux-only)
|
- [`FloatingContainerForceNativeTitleBar` (Linux only)](#floatingcontainerforcenativetitlebar-linux-only)
|
||||||
- [`MiddleMouseButtonClosesTab`](#middlemousebuttonclosestab)
|
- [`FloatingContainerForceQWidgetTitleBar` (Linux only)](#floatingcontainerforceqwidgettitlebar-linux-only)
|
||||||
- [`DisableTabTextEliding`](#disabletabtexteliding)
|
- [`MiddleMouseButtonClosesTab`](#middlemousebuttonclosestab)
|
||||||
- [`ShowTabTextOnlyForActiveTab`](#showtabtextonlyforactivetab)
|
- [`DisableTabTextEliding`](#disabletabtexteliding)
|
||||||
- [`DoubleClickUndocksWidget`](#doubleclickundockswidget)
|
- [`ShowTabTextOnlyForActiveTab`](#showtabtextonlyforactivetab)
|
||||||
- [Auto Hide Dock Widgets](#auto-hide-dock-widgets)
|
- [`DoubleClickUndocksWidget`](#doubleclickundockswidget)
|
||||||
- [Pinning Auto-Hide Widgets to a certain border](#pinning-auto-hide-widgets-to-a-certain-border)
|
- [`TabsAtBottom`](#tabsatbottom)
|
||||||
- [Show / Hide Auto-Hide Widgets via Mouse Over](#show--hide-auto-hide-widgets-via-mouse-over)
|
- [Auto Hide Dock Widgets](#auto-hide-dock-widgets)
|
||||||
- [Drag \& Drop to Auto-Hide](#drag--drop-to-auto-hide)
|
- [Pinning Auto-Hide Widgets to a certain border](#pinning-auto-hide-widgets-to-a-certain-border)
|
||||||
- [Auto-Hide Tab Insertion Order](#auto-hide-tab-insertion-order)
|
- [Show / Hide Auto-Hide Widgets via Mouse Over](#show--hide-auto-hide-widgets-via-mouse-over)
|
||||||
- [Auto-Hide Tab Sorting](#auto-hide-tab-sorting)
|
- [Drag \& Drop to Auto-Hide](#drag--drop-to-auto-hide)
|
||||||
- [Auto-Hide Drag to Float / Dock](#auto-hide-drag-to-float--dock)
|
- [Auto-Hide Tab Insertion Order](#auto-hide-tab-insertion-order)
|
||||||
- [Auto-Hide Context Menu](#auto-hide-context-menu)
|
- [Auto-Hide Tab Sorting](#auto-hide-tab-sorting)
|
||||||
- [Adding Auto Hide Widgets](#adding-auto-hide-widgets)
|
- [Auto-Hide Drag to Float / Dock](#auto-hide-drag-to-float--dock)
|
||||||
- [Auto-Hide Configuration Flags](#auto-hide-configuration-flags)
|
- [Auto-Hide Context Menu](#auto-hide-context-menu)
|
||||||
- [Setting Auto-Hide Flags](#setting-auto-hide-flags)
|
- [Adding Auto Hide Widgets](#adding-auto-hide-widgets)
|
||||||
- [`AutoHideFeatureEnabled`](#autohidefeatureenabled)
|
- [Auto-Hide Configuration Flags](#auto-hide-configuration-flags)
|
||||||
- [`DockAreaHasAutoHideButton`](#dockareahasautohidebutton)
|
- [Setting Auto-Hide Flags](#setting-auto-hide-flags)
|
||||||
- [`AutoHideButtonTogglesArea`](#autohidebuttontogglesarea)
|
- [`AutoHideFeatureEnabled`](#autohidefeatureenabled)
|
||||||
- [`AutoHideButtonCheckable`](#autohidebuttoncheckable)
|
- [`DockAreaHasAutoHideButton`](#dockareahasautohidebutton)
|
||||||
- [`AutoHideSideBarsIconOnly`](#autohidesidebarsicononly)
|
- [`AutoHideButtonTogglesArea`](#autohidebuttontogglesarea)
|
||||||
- [`AutoHideShowOnMouseOver`](#autohideshowonmouseover)
|
- [`AutoHideButtonCheckable`](#autohidebuttoncheckable)
|
||||||
- [`AutoHideCloseButtonCollapsesDock`](#autohideclosebuttoncollapsesdock)
|
- [`AutoHideSideBarsIconOnly`](#autohidesidebarsicononly)
|
||||||
- [`AutoHideHasCloseButton`](#autohidehasclosebutton)
|
- [`AutoHideShowOnMouseOver`](#autohideshowonmouseover)
|
||||||
- [`AutoHideHasMinimizeButton`](#autohidehasminimizebutton)
|
- [`AutoHideCloseButtonCollapsesDock`](#autohideclosebuttoncollapsesdock)
|
||||||
- [`AutoHideOpenOnDragHover`](#autohideopenondraghover)
|
- [`AutoHideHasCloseButton`](#autohidehasclosebutton)
|
||||||
- [`AutoHideCloseOnOutsideMouseClick`](#autohidecloseonoutsidemouseclick)
|
- [`AutoHideHasMinimizeButton`](#autohidehasminimizebutton)
|
||||||
- [DockWidget Feature Flags](#dockwidget-feature-flags)
|
- [`AutoHideOpenOnDragHover`](#autohideopenondraghover)
|
||||||
- [`DockWidgetClosable`](#dockwidgetclosable)
|
- [`AutoHideCloseOnOutsideMouseClick`](#autohidecloseonoutsidemouseclick)
|
||||||
- [`DockWidgetMovable`](#dockwidgetmovable)
|
- [DockWidget Feature Flags](#dockwidget-feature-flags)
|
||||||
- [`DockWidgetFloatable`](#dockwidgetfloatable)
|
- [`DockWidgetClosable`](#dockwidgetclosable)
|
||||||
- [`DockWidgetDeleteOnClose`](#dockwidgetdeleteonclose)
|
- [`DockWidgetMovable`](#dockwidgetmovable)
|
||||||
- [`CustomCloseHandling`](#customclosehandling)
|
- [`DockWidgetFloatable`](#dockwidgetfloatable)
|
||||||
- [`DockWidgetFocusable`](#dockwidgetfocusable)
|
- [`DockWidgetDeleteOnClose`](#dockwidgetdeleteonclose)
|
||||||
- [`DockWidgetForceCloseWithArea`](#dockwidgetforceclosewitharea)
|
- [`CustomCloseHandling`](#customclosehandling)
|
||||||
- [`NoTab`](#notab)
|
- [`DockWidgetFocusable`](#dockwidgetfocusable)
|
||||||
- [`DeleteContentOnClose`](#deletecontentonclose)
|
- [`DockWidgetForceCloseWithArea`](#dockwidgetforceclosewitharea)
|
||||||
- [Central Widget](#central-widget)
|
- [`NoTab`](#notab)
|
||||||
- [Empty Dock Area](#empty-dock-area)
|
- [`DeleteContentOnClose`](#deletecontentonclose)
|
||||||
- [Custom Close Handling](#custom-close-handling)
|
- [Central Widget](#central-widget)
|
||||||
- [Globally Lock Docking Features](#globally-lock-docking-features)
|
- [Empty Dock Area](#empty-dock-area)
|
||||||
- [Dock Widget Size / Minimum Size Handling](#dock-widget-size--minimum-size-handling)
|
- [Custom Close Handling](#custom-close-handling)
|
||||||
- [Styling](#styling)
|
- [Globally Lock Docking Features](#globally-lock-docking-features)
|
||||||
- [Disabling the Internal Style Sheet](#disabling-the-internal-style-sheet)
|
- [Dock Widget Size / Minimum Size Handling](#dock-widget-size--minimum-size-handling)
|
||||||
- [Using ADS on Linux](#using-ads-on-linux)
|
- [Styling](#styling)
|
||||||
- [Supported Distributions](#supported-distributions)
|
- [Disabling the Internal Style Sheet](#disabling-the-internal-style-sheet)
|
||||||
- [Requirements](#requirements)
|
- [Using ADS on Linux](#using-ads-on-linux)
|
||||||
- [Manjaro xfce 25.0.1 and Xubuntu 24.04.2 issues](#manjaro-xfce-2501-and-xubuntu-24042-issues)
|
- [Supported Distributions](#supported-distributions)
|
||||||
- [OpenGl + ADS](#opengl--ads)
|
- [Requirements](#requirements)
|
||||||
|
- [Manjaro xfce 25.0.1 and Xubuntu 24.04.2 issues](#manjaro-xfce-2501-and-xubuntu-24042-issues)
|
||||||
|
- [OpenGl + ADS](#opengl--ads)
|
||||||
|
|
||||||
## Configuration Flags
|
## Configuration Flags
|
||||||
|
|
||||||
@@ -510,6 +512,12 @@ for active tabs. Inactive tabs only show their icon:
|
|||||||
If the flag is set (default), a double click on a tab undocks the dock widget.
|
If the flag is set (default), a double click on a tab undocks the dock widget.
|
||||||
If you would like to disable undocking, just clear this flag.
|
If you would like to disable undocking, just clear this flag.
|
||||||
|
|
||||||
|
### `TabsAtBottom`
|
||||||
|
|
||||||
|
If the flag is set, tabs will be shown at the bottom instead of in the title bar.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Auto Hide Dock Widgets
|
## Auto Hide Dock Widgets
|
||||||
|
|
||||||
The Advanced Docking System supports "Auto-Hide" functionality for **all**
|
The Advanced Docking System supports "Auto-Hide" functionality for **all**
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ CMainWindow::CMainWindow(QWidget *parent)
|
|||||||
CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
|
CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
|
||||||
CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false);
|
CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false);
|
||||||
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
|
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
|
||||||
|
CDockManager::setConfigFlag(CDockManager::TabsAtBottom, true);
|
||||||
CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
|
CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
|
||||||
CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideOpenOnDragHover, true);
|
CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideOpenOnDragHover, true);
|
||||||
CDockManager::setConfigParam(CDockManager::AutoHideOpenOnDragHoverDelay_ms, 500);
|
CDockManager::setConfigParam(CDockManager::AutoHideOpenOnDragHoverDelay_ms, 500);
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Virtual Destructor
|
* Virtual Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~CAutoHideTab();
|
~CAutoHideTab() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update stylesheet style if a property changes
|
* Update stylesheet style if a property changes
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ target_link_libraries(${library_name} PUBLIC Qt${QT_VERSION_MAJOR}::Core
|
|||||||
Qt${QT_VERSION_MAJOR}::Gui
|
Qt${QT_VERSION_MAJOR}::Gui
|
||||||
Qt${QT_VERSION_MAJOR}::Widgets)
|
Qt${QT_VERSION_MAJOR}::Widgets)
|
||||||
|
|
||||||
if(QT_VERSION_MAJOR STREQUAL "6")
|
if(UNIX AND NOT APPLE AND QT_VERSION_MAJOR STREQUAL "6")
|
||||||
target_link_libraries(${library_name} PRIVATE Qt6::GuiPrivate) #needed for <qpa/qplatformnativeinterface.h>
|
target_link_libraries(${library_name} PRIVATE Qt6::GuiPrivate) #needed for <qpa/qplatformnativeinterface.h>
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -260,10 +260,10 @@ void DockAreaTitleBarPrivate::createAutoHideTitleLabel()
|
|||||||
{
|
{
|
||||||
AutoHideTitleLabel = new CElidingLabel("");
|
AutoHideTitleLabel = new CElidingLabel("");
|
||||||
AutoHideTitleLabel->setObjectName("autoHideTitleLabel");
|
AutoHideTitleLabel->setObjectName("autoHideTitleLabel");
|
||||||
// At position 0 is the tab bar - insert behind tab bar
|
// When the tabs are at the top, they will be at position 0, insert the label behind them, and hide it.
|
||||||
Layout->insertWidget(1, AutoHideTitleLabel);
|
Layout->addWidget(AutoHideTitleLabel);
|
||||||
AutoHideTitleLabel->setVisible(false); // Default hidden
|
AutoHideTitleLabel->setVisible(CDockManager::testConfigFlag(CDockManager::TabsAtBottom));
|
||||||
Layout->insertWidget(2 ,new CSpacerWidget(_this));
|
Layout->addWidget(new CSpacerWidget(_this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -272,7 +272,9 @@ void DockAreaTitleBarPrivate::createTabBar()
|
|||||||
{
|
{
|
||||||
TabBar = componentsFactory()->createDockAreaTabBar(DockArea);
|
TabBar = componentsFactory()->createDockAreaTabBar(DockArea);
|
||||||
TabBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
TabBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||||
Layout->addWidget(TabBar);
|
if (!CDockManager::testConfigFlag(CDockManager::TabsAtBottom))
|
||||||
|
Layout->addWidget(TabBar);
|
||||||
|
|
||||||
_this->connect(TabBar, SIGNAL(tabClosed(int)), SLOT(markTabsMenuOutdated()));
|
_this->connect(TabBar, SIGNAL(tabClosed(int)), SLOT(markTabsMenuOutdated()));
|
||||||
_this->connect(TabBar, SIGNAL(tabOpened(int)), SLOT(markTabsMenuOutdated()));
|
_this->connect(TabBar, SIGNAL(tabOpened(int)), SLOT(markTabsMenuOutdated()));
|
||||||
_this->connect(TabBar, SIGNAL(tabInserted(int)), SLOT(markTabsMenuOutdated()));
|
_this->connect(TabBar, SIGNAL(tabInserted(int)), SLOT(markTabsMenuOutdated()));
|
||||||
@@ -351,8 +353,8 @@ CDockAreaTitleBar::CDockAreaTitleBar(CDockAreaWidget* parent) :
|
|||||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||||
|
|
||||||
d->createTabBar();
|
d->createTabBar();
|
||||||
d->createButtons();
|
|
||||||
d->createAutoHideTitleLabel();
|
d->createAutoHideTitleLabel();
|
||||||
|
d->createButtons();
|
||||||
|
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
}
|
}
|
||||||
@@ -900,9 +902,12 @@ QString CDockAreaTitleBar::titleBarButtonToolTip(TitleBarButton Button) const
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockAreaTitleBar::showAutoHideControls(bool Show)
|
void CDockAreaTitleBar::showAutoHideControls(bool Show)
|
||||||
{
|
{
|
||||||
d->TabBar->setVisible(!Show); // Auto hide toolbar never has tabs
|
if (Show)
|
||||||
|
d->TabBar->setVisible(false); // Auto hide toolbar never has tabs
|
||||||
|
|
||||||
d->MinimizeButton->setVisible(Show);
|
d->MinimizeButton->setVisible(Show);
|
||||||
d->AutoHideTitleLabel->setVisible(Show);
|
if (!CDockManager::testConfigFlag(CDockManager::TabsAtBottom))
|
||||||
|
d->AutoHideTitleLabel->setVisible(Show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -179,14 +179,17 @@ public:
|
|||||||
parent->setUpdatesEnabled(false);
|
parent->setUpdatesEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto LayoutItem = m_ParentLayout->takeAt(1);
|
if (m_CurrentWidget)
|
||||||
if (LayoutItem)
|
|
||||||
{
|
{
|
||||||
LayoutItem->widget()->setParent(nullptr);
|
auto LayoutItem = m_ParentLayout->takeAt(1);
|
||||||
|
if (LayoutItem)
|
||||||
|
{
|
||||||
|
LayoutItem->widget()->setParent(nullptr);
|
||||||
|
}
|
||||||
|
delete LayoutItem;
|
||||||
}
|
}
|
||||||
delete LayoutItem;
|
|
||||||
|
|
||||||
m_ParentLayout->addWidget(next);
|
m_ParentLayout->insertWidget(1, next);
|
||||||
if (prev)
|
if (prev)
|
||||||
{
|
{
|
||||||
prev->hide();
|
prev->hide();
|
||||||
@@ -362,6 +365,14 @@ void DockAreaWidgetPrivate::createTitleBar()
|
|||||||
{
|
{
|
||||||
TitleBar = componentsFactory()->createDockAreaTitleBar(_this);
|
TitleBar = componentsFactory()->createDockAreaTitleBar(_this);
|
||||||
Layout->addWidget(TitleBar);
|
Layout->addWidget(TitleBar);
|
||||||
|
if (CDockManager::testConfigFlag(CDockManager::TabsAtBottom))
|
||||||
|
{
|
||||||
|
// Title bar will be index 0, container widgets will be index 1,
|
||||||
|
// so tabs will always be at the end of the layout.
|
||||||
|
Layout->addWidget(tabBar());
|
||||||
|
tabBar()->setVisible(CDockManager::testConfigFlag(CDockManager::AlwaysShowTabs));
|
||||||
|
}
|
||||||
|
|
||||||
QObject::connect(tabBar(), &CDockAreaTabBar::tabCloseRequested, _this, &CDockAreaWidget::onTabCloseRequested);
|
QObject::connect(tabBar(), &CDockAreaTabBar::tabCloseRequested, _this, &CDockAreaWidget::onTabCloseRequested);
|
||||||
QObject::connect(TitleBar, &CDockAreaTitleBar::tabBarClicked, _this, &CDockAreaWidget::setCurrentIndex);
|
QObject::connect(TitleBar, &CDockAreaTitleBar::tabBarClicked, _this, &CDockAreaWidget::setCurrentIndex);
|
||||||
QObject::connect(tabBar(), &CDockAreaTabBar::tabMoved, _this, &CDockAreaWidget::reorderDockWidget);
|
QObject::connect(tabBar(), &CDockAreaTabBar::tabMoved, _this, &CDockAreaWidget::reorderDockWidget);
|
||||||
@@ -726,6 +737,7 @@ void CDockAreaWidget::setCurrentIndex(int index)
|
|||||||
TabBar->setCurrentIndex(index);
|
TabBar->setCurrentIndex(index);
|
||||||
d->ContentsLayout->setCurrentIndex(index);
|
d->ContentsLayout->setCurrentIndex(index);
|
||||||
d->ContentsLayout->currentWidget()->show();
|
d->ContentsLayout->currentWidget()->show();
|
||||||
|
d->TitleBar->autoHideTitleLabel()->setText(d->ContentsLayout->currentWidget()->windowTitle());
|
||||||
Q_EMIT currentChanged(index);
|
Q_EMIT currentChanged(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -879,7 +891,22 @@ void CDockAreaWidget::updateTitleBarVisibility()
|
|||||||
{
|
{
|
||||||
// Always show title bar if it contains title bar actions
|
// Always show title bar if it contains title bar actions
|
||||||
if (CDockWidget* TopLevelWidget = Container->topLevelDockWidget())
|
if (CDockWidget* TopLevelWidget = Container->topLevelDockWidget())
|
||||||
|
{
|
||||||
Hidden |= TopLevelWidget->titleBarActions().empty();
|
Hidden |= TopLevelWidget->titleBarActions().empty();
|
||||||
|
}
|
||||||
|
else if (CDockManager::testConfigFlag(CDockManager::TabsAtBottom))
|
||||||
|
{
|
||||||
|
Hidden = true;
|
||||||
|
|
||||||
|
for (CDockWidget* DockWidget : Container->openedDockWidgets())
|
||||||
|
{
|
||||||
|
if (!DockWidget->titleBarActions().empty())
|
||||||
|
{
|
||||||
|
Hidden = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!Hidden && d->Flags.testFlag(HideSingleWidgetTitleBar))
|
if (!Hidden && d->Flags.testFlag(HideSingleWidgetTitleBar))
|
||||||
{
|
{
|
||||||
@@ -889,6 +916,8 @@ void CDockAreaWidget::updateTitleBarVisibility()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
d->TitleBar->setVisible(!Hidden);
|
d->TitleBar->setVisible(!Hidden);
|
||||||
|
if (CDockManager::testConfigFlag(CDockManager::TabsAtBottom))
|
||||||
|
d->TitleBar->tabBar()->setVisible(openDockWidgetsCount() > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAutoHideFeatureEnabled())
|
if (isAutoHideFeatureEnabled())
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Virtual Destructor
|
* Virtual Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~CDockAreaWidget();
|
~CDockAreaWidget() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the dock manager object this dock area belongs to
|
* Returns the dock manager object this dock area belongs to
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Virtual Destructor
|
* Virtual Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~CDockContainerWidget();
|
~CDockContainerWidget() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds dockwidget into the given area.
|
* Adds dockwidget into the given area.
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QDialog>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QXmlStreamWriter>
|
#include <QXmlStreamWriter>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
@@ -530,15 +531,30 @@ CDockManager::CDockManager(QWidget *parent) :
|
|||||||
window()->installEventFilter(this);
|
window()->installEventFilter(this);
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||||
connect(qApp, &QApplication::focusWindowChanged, [this](QWindow* focusWindow)
|
connect(qApp, &QApplication::focusWindowChanged, this, [this](QWindow* focusWindow)
|
||||||
{
|
{
|
||||||
if (!focusWindow)
|
if (!focusWindow)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bring the main application window that hosts the dock manager and all floating
|
auto widget = QWidget::find(focusWindow->winId());
|
||||||
// widgets in front of any other application
|
if (!widget)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the user clicks the main window or drags a floating widget or works with a
|
||||||
|
// dialog, then raise the main window, all floating widgets and the focus window
|
||||||
|
// itself to bring it into foregreound of any other application
|
||||||
|
bool raise = qobject_cast<QMainWindow*>(widget)
|
||||||
|
|| qobject_cast<QDialog*>(widget)
|
||||||
|
|| qobject_cast<ads::CFloatingDockContainer*>(widget);
|
||||||
|
if (!raise)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this->raise();
|
this->raise();
|
||||||
for (auto FloatingWidget : d->FloatingWidgets)
|
for (auto FloatingWidget : d->FloatingWidgets)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ public:
|
|||||||
DisableTabTextEliding = 0x4000000, //! Set this flag to disable eliding of tab texts in dock area tabs
|
DisableTabTextEliding = 0x4000000, //! Set this flag to disable eliding of tab texts in dock area tabs
|
||||||
ShowTabTextOnlyForActiveTab =0x8000000, //! Set this flag to show label texts in dock area tabs only for active tabs
|
ShowTabTextOnlyForActiveTab =0x8000000, //! Set this flag to show label texts in dock area tabs only for active tabs
|
||||||
DoubleClickUndocksWidget = 0x10000000, //!< If the flag is set, a double click on a tab undocks the widget
|
DoubleClickUndocksWidget = 0x10000000, //!< If the flag is set, a double click on a tab undocks the widget
|
||||||
|
TabsAtBottom = 0x20000000, //!< If the flag is set, tabs will be shown at the bottom instead of in the title bar.
|
||||||
|
|
||||||
|
|
||||||
DefaultDockAreaButtons = DockAreaHasCloseButton
|
DefaultDockAreaButtons = DockAreaHasCloseButton
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Virtual Destructor
|
* Virtual Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~CDockWidget();
|
~CDockWidget() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We return a fixed minimum size hint or the size hint of the content
|
* We return a fixed minimum size hint or the size hint of the content
|
||||||
|
|||||||
@@ -539,7 +539,7 @@ QMenu* CDockWidgetTab::buildContextMenu(QMenu *Menu)
|
|||||||
Menu = new QMenu(this);
|
Menu = new QMenu(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "CDockWidgetTab::buildContextMenu";
|
ADS_PRINT("CDockWidgetTab::buildContextMenu");
|
||||||
const bool isFloatable = d->DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable);
|
const bool isFloatable = d->DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable);
|
||||||
const bool isTopLevelArea = d->DockArea->isTopLevelArea();
|
const bool isTopLevelArea = d->DockArea->isTopLevelArea();
|
||||||
const bool isFloating = d->DockWidget->isFloating();
|
const bool isFloating = d->DockWidget->isFloating();
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Virtual Destructor
|
* Virtual Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~CFloatingDockContainer();
|
~CFloatingDockContainer() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access function for the internal dock container
|
* Access function for the internal dock container
|
||||||
|
|||||||
@@ -82,6 +82,10 @@ ads--CDockWidgetTab[activeTab="true"] QLabel {
|
|||||||
color: palette(foreground);
|
color: palette(foreground);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#autoHideTitleLabel {
|
||||||
|
padding-left: 4px;
|
||||||
|
color: palette(foreground);
|
||||||
|
}
|
||||||
|
|
||||||
#tabCloseButton {
|
#tabCloseButton {
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
@@ -278,7 +282,7 @@ ads--CAutoHideDockContainer ads--CDockAreaWidget[focused="true"] ads--CDockAreaT
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#autoHideTitleLabel {
|
ads--CAutoHideDockContainer #autoHideTitleLabel {
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
color: palette(light);
|
color: palette(light);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ ads--CTitleBarButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#autoHideTitleLabel {
|
||||||
|
padding-left: 4px;
|
||||||
|
color: palette(foreground);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#tabsMenuButton {
|
#tabsMenuButton {
|
||||||
qproperty-icon: url(:/ads/images/tabs-menu-button.svg);
|
qproperty-icon: url(:/ads/images/tabs-menu-button.svg);
|
||||||
qproperty-iconSize: 16px;
|
qproperty-iconSize: 16px;
|
||||||
@@ -88,6 +94,12 @@ ads--CDockWidgetTab[activeTab="true"] QLabel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#autoHideTitleLabel {
|
||||||
|
padding-left: 4px;
|
||||||
|
color: palette(foreground);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#tabCloseButton {
|
#tabCloseButton {
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
background: none;
|
background: none;
|
||||||
@@ -314,7 +326,7 @@ ads--CAutoHideDockContainer ads--CDockAreaWidget[focused="true"] ads--CDockAreaT
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#autoHideTitleLabel {
|
ads--CAutoHideDockContainer #autoHideTitleLabel {
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
color: palette(light);
|
color: palette(light);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,6 +95,10 @@ ads--CDockWidgetTab[activeTab="true"] QLabel {
|
|||||||
color: palette(foreground);
|
color: palette(foreground);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#autoHideTitleLabel {
|
||||||
|
padding-left: 4px;
|
||||||
|
color: palette(foreground);
|
||||||
|
}
|
||||||
|
|
||||||
#tabCloseButton {
|
#tabCloseButton {
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
@@ -316,7 +320,7 @@ ads--CAutoHideDockContainer ads--CDockAreaWidget[focused="true"] ads--CDockAreaT
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#autoHideTitleLabel {
|
ads--CAutoHideDockContainer #autoHideTitleLabel {
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
color: palette(light);
|
color: palette(light);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,12 @@ ads--CTitleBarButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#autoHideTitleLabel {
|
||||||
|
padding-left: 4px;
|
||||||
|
color: palette(foreground);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#tabsMenuButton {
|
#tabsMenuButton {
|
||||||
qproperty-icon: url(:/ads/images/tabs-menu-button.svg);
|
qproperty-icon: url(:/ads/images/tabs-menu-button.svg);
|
||||||
qproperty-iconSize: 16px;
|
qproperty-iconSize: 16px;
|
||||||
@@ -391,7 +397,7 @@ ads--CAutoHideDockContainer ads--CDockAreaWidget[focused="true"] ads--CDockAreaT
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#autoHideTitleLabel {
|
ads--CAutoHideDockContainer #autoHideTitleLabel {
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
color: palette(light);
|
color: palette(light);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user