Skip to content

Commit bbb3f99

Browse files
Added documentation for new features (central widget and native floating widgets on linux) to user-guide.md
1 parent e0f6f30 commit bbb3f99

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ integrated development environments (IDEs) such as Visual Studio.
1515

1616
## New and Noteworthy
1717

18+
The [release 3.6.0](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/tag/3.6.0)
19+
adds some nice new features:
20+
21+
- support for [central widget](doc/user-guide.md#central-widget) concept
22+
23+
![Central Widget](doc/central_widget.gif)
24+
25+
- support for [native floating widgets](doc/user-guide.md#floatingcontainerforcenativetitlebar-linux-only) on Linux
26+
27+
![FloatingContainerForceNativeTitleBar true](doc/cfg_flag_FloatingContainerForceNativeTitleBar_true.png)
28+
29+
Both features are contributions from ADS users. Read the [documentation](doc/user-guide.md)
30+
to learn more about both new features.
31+
1832
The [release 3.5.0](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/tag/3.5.0)
1933
adds the new [focus highlighting](doc/user-guide.md#focushighlighting) feature.
2034
This optional feature enables highlighting of the focused dock widget like you

doc/user-guide.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
- [`FloatingContainerHasWidgetIcon`](#floatingcontainerhaswidgeticon)
2525
- [`HideSingleCentralWidgetTitleBar`](#hidesinglecentralwidgettitlebar)
2626
- [`FocusHighlighting`](#focushighlighting)
27+
- [`EqualSplitOnInsertion`](#equalsplitoninsertion)
28+
- [`FloatingContainerForceNativeTitleBar` (Linux only)](#floatingcontainerforcenativetitlebar-linux-only)
29+
- [`FloatingContainerForceQWidgetTitleBar` (Linux only)](#floatingcontainerforceqwidgettitlebar-linux-only)
30+
- [Central Widget](#central-widget)
2731
- [Styling](#styling)
2832
- [Disabling the Internal Style Sheet](#disabling-the-internal-style-sheet)
2933

@@ -409,6 +413,81 @@ bool CMainWindow::eventFilter(QObject *watched, QEvent *event)
409413
}
410414
```
411415

416+
### `EqualSplitOnInsertion`
417+
418+
This flag configures how the space is distributed if a new dock widget is
419+
inserted into an existing dock area. The flag is disabled by default. If 3
420+
dock widgets are inserted with the following code
421+
422+
```c++
423+
d->DockManager->addDockWidget(ads::RightDockWidgetArea, DockWidget, EditorArea);
424+
```
425+
426+
then this is the result, if the flag is disabled:
427+
428+
![EqualSplitOnInsertion false](cfg_flag_EqualSplitOnInsertion_false.png)
429+
430+
If the flag is enabled, then the space is equally distributed to all widgets
431+
in a splitter:
432+
433+
![EqualSplitOnInsertion true](cfg_flag_EqualSplitOnInsertion_true.png)
434+
435+
436+
### `FloatingContainerForceNativeTitleBar` (Linux only)
437+
438+
Since release 3.6 the library supports native titlebars and window decorations
439+
for floating widgets on Linux (thanks to a user contribution).
440+
Native titlebars and window decorations are supported by most Linux window
441+
managers, such as Compiz or Xfwm. Some window managers like KWin do not properly
442+
support this feature. Native floating widgets look better because of the native
443+
styling and the support all window manager features like snapping to window
444+
borders or maximizing. The library tries to detect the window manager and
445+
activates native window decorations if possible:
446+
447+
![FloatingContainerForceNativeTitleBar true](cfg_flag_FloatingContainerForceNativeTitleBar_true.png)
448+
449+
If you would like to overwrite this autodetection, then you can activate this
450+
flag to force native window titlebars. You can overwrite autodetection and this
451+
flag, if you set the environment variable `ADS_UseNativeTitle` to 0 or 1.
452+
453+
### `FloatingContainerForceQWidgetTitleBar` (Linux only)
454+
455+
If your window manager (i.e. KWin) does not properly support native floating
456+
windows, the docking library falls back to QWidget based titlebars for
457+
floating widgets.
458+
459+
![FloatingContainerForceNativeTitleBar false](cfg_flag_FloatingContainerForceNativeTitleBar_false.png)
460+
461+
If you would like to overwrite autodetection, thne you can activate this flag
462+
to force QWidget based titlebars. You can overwrite autodetection and this
463+
flag, if you set the environment variable `ADS_UseNativeTitle` to 0 or 1.
464+
465+
## Central Widget
466+
467+
The Advanced Docking System has been developed to overcome the limitations of
468+
the native Qt docking system with its central widget concept. This was the
469+
reason that until version 3.6 of the library, there was no support for such
470+
thing like a central widget. Thanks to the contribution of a user the library
471+
now supports a central widget.
472+
473+
In the Advanced Docking System a central widget is a docking widget that is
474+
neither closable nor movable or floatable. A central widget has no title bar
475+
and so it is not possible for the user to hide, close or drag the central
476+
widget. Tf there is a central widget, then also the distribution of the sizes
477+
for the dock widgets around the central widget is different. If there is no
478+
central widget and the main windo is resized, then the available space is
479+
distributed to all dock widgets. If a central widget exists, then only the
480+
central widget is resized when resizing the main window. The dock widgets around
481+
the central widget keep their sizes. The following animation shows this:
482+
483+
![Central Widget](central_widget.gif)
484+
485+
To set a centra widget, you just need to call the
486+
487+
```c++
488+
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
489+
```
490+
412491
## Styling
413492

414493
The Advanced Docking System supports styling via [Qt Style Sheets](https://doc.qt.io/qt-5/stylesheet.html). All components like splitters, tabs, buttons, titlebar and

0 commit comments

Comments
 (0)