mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-13 00:30:25 +08:00
Added new config flag DoubleClickUndocksWidget to configure if double clicking a DockWidget tab or titlebar undocks the widget
This commit is contained in:
parent
e2f611ea9a
commit
7245dced84
@ -37,6 +37,7 @@ CMainWindow::CMainWindow(QWidget *parent)
|
|||||||
ads::CDockManager::setConfigFlag( ads::CDockManager::DockAreaHasUndockButton, false );
|
ads::CDockManager::setConfigFlag( ads::CDockManager::DockAreaHasUndockButton, false );
|
||||||
ads::CDockManager::setConfigFlag( ads::CDockManager::DockAreaDynamicTabsMenuButtonVisibility, true );
|
ads::CDockManager::setConfigFlag( ads::CDockManager::DockAreaDynamicTabsMenuButtonVisibility, true );
|
||||||
ads::CDockManager::setConfigFlag( ads::CDockManager::DisableTabTextEliding, true );
|
ads::CDockManager::setConfigFlag( ads::CDockManager::DisableTabTextEliding, true );
|
||||||
|
ads::CDockManager::setConfigFlag( ads::CDockManager::DoubleClickUndocksWidget, false );
|
||||||
DockManager = new CDockManager(this);
|
DockManager = new CDockManager(this);
|
||||||
|
|
||||||
// Set central widget
|
// Set central widget
|
||||||
|
@ -733,6 +733,11 @@ void CDockAreaTitleBar::mouseDoubleClickEvent(QMouseEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!CDockManager::testConfigFlag(CDockManager::DoubleClickUndocksWidget))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
d->makeAreaFloating(event->pos(), DraggingInactive);
|
d->makeAreaFloating(event->pos(), DraggingInactive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,6 +215,8 @@ public:
|
|||||||
MiddleMouseButtonClosesTab = 0x2000000, //! If the flag is set, the user can use the mouse middle button to close the tab under the mouse
|
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
|
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
|
||||||
|
|
||||||
|
|
||||||
DefaultDockAreaButtons = DockAreaHasCloseButton
|
DefaultDockAreaButtons = DockAreaHasCloseButton
|
||||||
| DockAreaHasUndockButton
|
| DockAreaHasUndockButton
|
||||||
@ -223,7 +225,8 @@ public:
|
|||||||
DefaultBaseConfig = DefaultDockAreaButtons
|
DefaultBaseConfig = DefaultDockAreaButtons
|
||||||
| ActiveTabHasCloseButton
|
| ActiveTabHasCloseButton
|
||||||
| XmlCompressionEnabled
|
| XmlCompressionEnabled
|
||||||
| FloatingContainerHasWidgetTitle, ///< default base configuration settings
|
| FloatingContainerHasWidgetTitle
|
||||||
|
| DoubleClickUndocksWidget, ///< default base configuration settings
|
||||||
|
|
||||||
DefaultOpaqueConfig = DefaultBaseConfig
|
DefaultOpaqueConfig = DefaultBaseConfig
|
||||||
| OpaqueSplitterResize
|
| OpaqueSplitterResize
|
||||||
|
@ -699,7 +699,7 @@ QString CDockWidgetTab::text() const
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockWidgetTab::mouseDoubleClickEvent(QMouseEvent *event)
|
void CDockWidgetTab::mouseDoubleClickEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton && CDockManager::testConfigFlag(CDockManager::DoubleClickUndocksWidget))
|
||||||
{
|
{
|
||||||
// If this is the last dock area in a dock container it does not make
|
// If this is the last dock area in a dock container it does not make
|
||||||
// sense to move it to a new floating widget and leave this one
|
// sense to move it to a new floating widget and leave this one
|
||||||
|
Loading…
Reference in New Issue
Block a user