mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-23 21:12:06 +08:00
Implemented issue #694 - added auto hide configuration flag AutoHideCloseOnOutsideMouseClick
This commit is contained in:
parent
979d76aa47
commit
faf24cd531
@ -769,6 +769,9 @@ CMainWindow::CMainWindow(QWidget *parent) :
|
|||||||
// uncomment if you would like to enable dock widget auto hiding
|
// uncomment if you would like to enable dock widget auto hiding
|
||||||
CDockManager::setAutoHideConfigFlags({CDockManager::DefaultAutoHideConfig});
|
CDockManager::setAutoHideConfigFlags({CDockManager::DefaultAutoHideConfig});
|
||||||
|
|
||||||
|
// uncomment if you would like to disable closing auto hide widget with mouse click outside of auto hide container
|
||||||
|
//CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideCloseOnOutsideMouseClick, false);
|
||||||
|
|
||||||
// uncomment if you would like to enable an equal distribution of the
|
// uncomment if you would like to enable an equal distribution of the
|
||||||
// available size of a splitter to all contained dock widgets
|
// available size of a splitter to all contained dock widgets
|
||||||
// CDockManager::setConfigFlag(CDockManager::EqualSplitOnInsertion, true);
|
// CDockManager::setConfigFlag(CDockManager::EqualSplitOnInsertion, true);
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
- [`AutoHideHasCloseButton`](#autohidehasclosebutton)
|
- [`AutoHideHasCloseButton`](#autohidehasclosebutton)
|
||||||
- [`AutoHideHasMinimizeButton`](#autohidehasminimizebutton)
|
- [`AutoHideHasMinimizeButton`](#autohidehasminimizebutton)
|
||||||
- [`AutoHideOpenOnDragHover`](#autohideopenondraghover)
|
- [`AutoHideOpenOnDragHover`](#autohideopenondraghover)
|
||||||
|
- [`AutoHideCloseOnOutsideMouseClick`](#autohidecloseonoutsidemouseclick)
|
||||||
- [DockWidget Feature Flags](#dockwidget-feature-flags)
|
- [DockWidget Feature Flags](#dockwidget-feature-flags)
|
||||||
- [`DockWidgetClosable`](#dockwidgetclosable)
|
- [`DockWidgetClosable`](#dockwidgetclosable)
|
||||||
- [`DockWidgetMovable`](#dockwidgetmovable)
|
- [`DockWidgetMovable`](#dockwidgetmovable)
|
||||||
@ -713,7 +714,6 @@ If this flag is set (disabled by default), then each auto hide widget has a mini
|
|||||||
|
|
||||||
![AutoHideHasMinimizeButton](cfg_flag_AutoHideHasMinimizeButton.png)
|
![AutoHideHasMinimizeButton](cfg_flag_AutoHideHasMinimizeButton.png)
|
||||||
|
|
||||||
|
|
||||||
### `AutoHideOpenOnDragHover`
|
### `AutoHideOpenOnDragHover`
|
||||||
|
|
||||||
If this flag is set (disabled by default), then holding a dragging cursor hover an auto-hide collapsed dock's tab will open said dock:
|
If this flag is set (disabled by default), then holding a dragging cursor hover an auto-hide collapsed dock's tab will open said dock:
|
||||||
@ -722,6 +722,12 @@ If this flag is set (disabled by default), then holding a dragging cursor hover
|
|||||||
|
|
||||||
Said dock must be set to accept drops to hide when cursor leaves its scope. See `AutoHideDragNDropExample` for more details.
|
Said dock must be set to accept drops to hide when cursor leaves its scope. See `AutoHideDragNDropExample` for more details.
|
||||||
|
|
||||||
|
### `AutoHideCloseOnOutsideMouseClick`
|
||||||
|
|
||||||
|
If this flag is set (default), the auto hide dock container will collapse if the
|
||||||
|
user clicks outside of the container. If not set, the auto hide container can be
|
||||||
|
closed only via click on auto hide sidebar tab.
|
||||||
|
|
||||||
## DockWidget Feature Flags
|
## DockWidget Feature Flags
|
||||||
|
|
||||||
### `DockWidgetClosable`
|
### `DockWidgetClosable`
|
||||||
|
@ -602,8 +602,12 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
|
|||||||
return Super::eventFilter(watched, event);
|
return Super::eventFilter(watched, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
// user clicked into container - collapse the auto hide widget
|
// user clicked outside of autohide container - collapse the auto hide widget
|
||||||
collapseView(true);
|
if (CDockManager::testAutoHideConfigFlag(
|
||||||
|
CDockManager::AutoHideCloseOnOutsideMouseClick))
|
||||||
|
{
|
||||||
|
collapseView(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (event->type() == internal::FloatingWidgetDragStartEvent)
|
else if (event->type() == internal::FloatingWidgetDragStartEvent)
|
||||||
{
|
{
|
||||||
|
@ -258,10 +258,12 @@ public:
|
|||||||
AutoHideHasCloseButton = 0x80, //< If the flag is set an auto hide title bar has a close button
|
AutoHideHasCloseButton = 0x80, //< If the flag is set an auto hide title bar has a close button
|
||||||
AutoHideHasMinimizeButton = 0x100, ///< if this flag is set, the auto hide title bar has a minimize button to collapse the dock widget
|
AutoHideHasMinimizeButton = 0x100, ///< if this flag is set, the auto hide title bar has a minimize button to collapse the dock widget
|
||||||
AutoHideOpenOnDragHover = 0x200, ///< if this flag is set, dragging hover the tab bar will open the dock
|
AutoHideOpenOnDragHover = 0x200, ///< if this flag is set, dragging hover the tab bar will open the dock
|
||||||
|
AutoHideCloseOnOutsideMouseClick = 0x400, ///< if this flag is set, the auto hide dock container will collapse if the user clicks outside of the container, if not set, the auto hide container can be closed only via click on sidebar tab
|
||||||
|
|
||||||
DefaultAutoHideConfig = AutoHideFeatureEnabled
|
DefaultAutoHideConfig = AutoHideFeatureEnabled
|
||||||
| DockAreaHasAutoHideButton
|
| DockAreaHasAutoHideButton
|
||||||
| AutoHideHasMinimizeButton
|
| AutoHideHasMinimizeButton
|
||||||
|
| AutoHideCloseOnOutsideMouseClick
|
||||||
|
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(AutoHideFlags, eAutoHideFlag)
|
Q_DECLARE_FLAGS(AutoHideFlags, eAutoHideFlag)
|
||||||
|
Loading…
Reference in New Issue
Block a user