update user guide

This commit is contained in:
Syarif Fakhri 2022-10-13 15:24:11 +08:00
parent b51c56e286
commit 589a62fe15

View File

@ -622,9 +622,7 @@ Note: Overlay, Pin, and Auto Hide here all refer to the same functionality.
### Setting Configuration Flags ### Setting Configuration Flags
Setting and enabling the overlay feature is similar to setting config flags, but do be aware that it uses a different eOverlayFlag enum and not the eConfigFlag enum. This is only relevant if you call `CDockManager::setConfigFlags` for the `ConfigFlags`, as it would mean you have to call `CDockManager::setConfigFlags` a second time for the `OverlayFlags`. Setting and enabling the overlay feature is similar to setting config flags, but do be aware that it uses a different eOverlayFlag enum and not the eConfigFlag enum. This is only relevant if you call `CDockManager::setConfigFlags` for the `ConfigFlags`, as it would mean you have to call `CDockManager::setConfigFlags` a second time for the `AutoHideFlags`.
Note: The dock areas collapse on losing focus, so the `FocusHighlighting` feature must be enabled for collapsing an overlay to work. Furthermore, widgets that don't have focus (e.g. by setting DockWidgetFocusable to false), will also prevent the dock widget from losing focus. The widgets are still collapsible on clicking the tab, so it's up to you if you would like collapsing the dock view based on losing focus.
```c++ ```c++
CDockManager::setConfigFlags(CDockManager::DefaultAutoHideConfig); CDockManager::setConfigFlags(CDockManager::DefaultAutoHideConfig);
@ -633,9 +631,9 @@ CDockManager::setConfigFlag(CDockManager::LeftSideBarPrioritizeIconOnly, true);
d->DockManager = new CDockManager(this); d->DockManager = new CDockManager(this);
``` ```
### Adding Overlay Widgets ### Adding Auto Hide Widgets
Adding an overlay widget is similar to adding a dock widget, simply call `dockManager->addOverlayDockWidget`. Adding an overlay widget is similar to adding a dock widget, simply call `dockManager->addAutoHideDockWidget`.
```c++ ```c++
d->DockManager = new CDockManager(this); d->DockManager = new CDockManager(this);
@ -646,19 +644,19 @@ DockManager->addOverlayDockWidget(CDockWidgetSideTab::SideTabBarArea::LeftTop, T
See `autohide` example to learn how it works. See `autohide` example to learn how it works.
### Configuration Flags For Overlay Widgets ### Configuration Flags For Auto Hide Widgets
- `DockContainerHasLeftSideBar`, `DockContainerHasRightSideBar`, `DockContainerHasBottomSideBar` -> Enabling each of these enables the side bar at each location. Disabling any of them would mean that the widget cannot be added at that location, so it would be added at the next available location. E.g. If you only enable `DockContainerHasRightSideBar` and `DockContainerHasBottomSideBar` then it will be added to the bottom side bar or right side bar respectively. If none of these are enabled, the auto hide button will not be added, as at least one of them must be enabled to work. - `DockContainerHasLeftSideBar`, `DockContainerHasRightSideBar`, `DockContainerHasBottomSideBar` -> Enabling each of these enables the side bar at each location. Disabling any of them would mean that the widget cannot be added at that location, so it would be added at the next available location. E.g. If you only enable `DockContainerHasRightSideBar` and `DockContainerHasBottomSideBar` then it will be added to the bottom side bar or right side bar respectively. If none of these are enabled, the auto hide button will not be added, as at least one of them must be enabled to work.
- `DockAreaHasAutoHideButton` -> Adds the auto hide button to the title bar of the dock area - `DockAreaHasAutoHideButton` -> Adds the auto hide button to the title bar of the dock area
- `LeftSideBarPrioritizeIconOnly`, `RightSideBarPrioritizeIconOnly`, `BottomSideBarPrioritizeIconOnly` -> If this is set, the side bar this is enabled with will prioritize showing an icon only, as opposed to an icon and text. This is set per side bar, so if you only enable `LeftSideBarPrioritizeIconOnly`, the right and bottom side bars will still show the icon and the text. This is only relevant if an icon is set, otherwise it will only show text as usual. - `LeftSideBarPrioritizeIconOnly`, `RightSideBarPrioritizeIconOnly`, `BottomSideBarPrioritizeIconOnly` -> If this is set, the side bar this is enabled with will prioritize showing an icon only, as opposed to an icon and text. This is set per side bar, so if you only enable `LeftSideBarPrioritizeIconOnly`, the right and bottom side bars will still show the icon and the text. This is only relevant if an icon is set, otherwise it will only show text as usual.
- `DockAreaOverlayHasTitle` -> Adds the title of the dock window where the title bar would be. - `AutoHideDockAreaHasTitle` -> Adds the title of the dock window where the title bar would be.
- `DefaultAutoHideConfig` -> Enables `DockContainerHasLeftSideBar`, `DockContainerHasRightSideBar`, `DockContainerHasBottomSideBar`, `DockAreaHasAutoHideButton`, `DockAreaOverlayHasTitle` - `DefaultAutoHideConfig` -> Enables `DockContainerHasLeftSideBar`, `DockContainerHasRightSideBar`, `DockContainerHasBottomSideBar`, `DockAreaHasAutoHideButton`, `AutoHideDockAreaHasTitle`
### Limitations ### Limitations
- Currently the `LeftBottom` and `RightBottom` areas can only be added programatically, and not through the pin icon. These are used if you'd like to add a new dock widget separated from the normal dock areas. - Currently the `LeftBottom` and `RightBottom` areas can only be added programatically, and not through the pin icon. These are used if you'd like to add a new dock widget separated from the normal dock areas.
- Adding a `DockWidget` (e.g. via `addDockWidget`) to an overlayed `DockArea` that already has a dockwidget is undefined behavior. An overlayed dock area does not have tabs and does not support more than one `DockWidget` in it's area. If you want to add a `DockWidget` to a `DockArea` that *could* be overlayed, check first if it's overlayed via `CDockArea::isOverlayed` and handle it accordingly (typically by adding the overlay dock widget as a side tab instead of to the area). - Adding a `DockWidget` (e.g. via `addDockWidget`) to an overlayed `DockArea` that already has a dockwidget is undefined behavior. An overlayed dock area does not have tabs and does not support more than one `DockWidget` in it's area. If you want to add a `DockWidget` to a `DockArea` that *could* be overlayed, check first if it's overlayed via `CDockArea::isAutoHide` and handle it accordingly (typically by adding the overlay dock widget as a side tab instead of to the area).
## Styling ## Styling