|
24 | 24 | - [`FloatingContainerHasWidgetIcon`](#floatingcontainerhaswidgeticon) |
25 | 25 | - [`HideSingleCentralWidgetTitleBar`](#hidesinglecentralwidgettitlebar) |
26 | 26 | - [`FocusHighlighting`](#focushighlighting) |
| 27 | + - [`EqualSplitOnInsertion`](#equalsplitoninsertion) |
| 28 | + - [`FloatingContainerForceNativeTitleBar` (Linux only)](#floatingcontainerforcenativetitlebar-linux-only) |
| 29 | + - [`FloatingContainerForceQWidgetTitleBar` (Linux only)](#floatingcontainerforceqwidgettitlebar-linux-only) |
| 30 | +- [Central Widget](#central-widget) |
27 | 31 | - [Styling](#styling) |
28 | 32 | - [Disabling the Internal Style Sheet](#disabling-the-internal-style-sheet) |
29 | 33 |
|
@@ -409,6 +413,93 @@ bool CMainWindow::eventFilter(QObject *watched, QEvent *event) |
409 | 413 | } |
410 | 414 | ``` |
411 | 415 |
|
| 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 | + |
| 429 | +
|
| 430 | +If the flag is enabled, then the space is equally distributed to all widgets |
| 431 | +in a splitter: |
| 432 | +
|
| 433 | + |
| 434 | +
|
| 435 | +
|
| 436 | +### `FloatingContainerForceNativeTitleBar` (Linux only) |
| 437 | +
|
| 438 | +Since release 3.6 the library supports native title bars and window decorations |
| 439 | +for floating widgets on Linux (thanks to a user contribution). |
| 440 | +Native title bars 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 during |
| 445 | +runtime and activates native window decorations if possible: |
| 446 | +
|
| 447 | + |
| 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 floating widget |
| 457 | +title bars. |
| 458 | +
|
| 459 | + |
| 460 | +
|
| 461 | +If you would like to overwrite autodetection, then you can activate this flag |
| 462 | +to force QWidget based title bars. 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. If there is a central widget, then also the distribution of the sizes |
| 477 | +for the dock widgets around the central widget is different: |
| 478 | +
|
| 479 | +- **no central widget (default)** - on resizing the available space is |
| 480 | +distributed to all dock widgets - the size of all dock widgets |
| 481 | +shrinks or grows |
| 482 | +- **with central widget** - on resizing only the central widget is resized - the |
| 483 | +dock widgets around the central widget keep their size (see the animation below) |
| 484 | +
|
| 485 | + |
| 486 | +
|
| 487 | +To set a central widget, you just need to pass your central dock widget |
| 488 | +to the dock manager `setCentralWidget` function: |
| 489 | +
|
| 490 | +```c++ |
| 491 | +auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget); |
| 492 | +``` |
| 493 | + |
| 494 | +See the `centralwidget` example to learn how it works. |
| 495 | + |
| 496 | +> ##### Note |
| 497 | +> The central widget needs to be the first dock widget that is added to the |
| 498 | +> dock manager. The function does not work and returns a `nullptr` if there |
| 499 | +> are already other dock widgets registered. So `setCentralWidget` should be |
| 500 | +> the first function that you call when adding dock widgets. |
| 501 | +
|
| 502 | + |
412 | 503 | ## Styling |
413 | 504 |
|
414 | 505 | 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