mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +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::DockAreaDynamicTabsMenuButtonVisibility, true );
|
||||
ads::CDockManager::setConfigFlag( ads::CDockManager::DisableTabTextEliding, true );
|
||||
ads::CDockManager::setConfigFlag( ads::CDockManager::DoubleClickUndocksWidget, false );
|
||||
DockManager = new CDockManager(this);
|
||||
|
||||
// Set central widget
|
||||
|
@ -733,6 +733,11 @@ void CDockAreaTitleBar::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CDockManager::testConfigFlag(CDockManager::DoubleClickUndocksWidget))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
DoubleClickUndocksWidget = 0x10000000, //!< If the flag is set, a double click on a tab undocks the widget
|
||||
|
||||
|
||||
DefaultDockAreaButtons = DockAreaHasCloseButton
|
||||
| DockAreaHasUndockButton
|
||||
@ -223,7 +225,8 @@ public:
|
||||
DefaultBaseConfig = DefaultDockAreaButtons
|
||||
| ActiveTabHasCloseButton
|
||||
| XmlCompressionEnabled
|
||||
| FloatingContainerHasWidgetTitle, ///< default base configuration settings
|
||||
| FloatingContainerHasWidgetTitle
|
||||
| DoubleClickUndocksWidget, ///< default base configuration settings
|
||||
|
||||
DefaultOpaqueConfig = DefaultBaseConfig
|
||||
| OpaqueSplitterResize
|
||||
|
@ -699,7 +699,7 @@ QString CDockWidgetTab::text() const
|
||||
//============================================================================
|
||||
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
|
||||
// sense to move it to a new floating widget and leave this one
|
||||
|
Loading…
Reference in New Issue
Block a user