Introduce "Maximize/restore" title bar button support

As happens with other docking frameworks:
- Maximized/restore button only visible when window is floating
- floating button is never visible

Available by setting Flag_TitleBarHasMaximizeButton.
Added example too.

Fixes: #37
This commit is contained in:
Sergio Martins
2020-04-20 19:54:03 +01:00
parent ab0fc1e328
commit 6ee3cfbb2d
9 changed files with 81 additions and 6 deletions

View File

@@ -69,6 +69,7 @@ public:
Flag_LazyResize = 32, /// The dock widgets are resized in a lazy manner. The actual resize only happens when you release the mouse button.
Flag_TabsHaveCloseButton = 64, /// Tabs will have a close button. Equivalent to QTabWidget::setTabsClosable(true).
Flag_DoubleClickMaximizes = 128, /// Double clicking the titlebar will maximize a floating window instead of re-docking it
Flag_TitleBarHasMaximizeButton = 256, /// The title bar will have a maximize/restore button when floating. This is mutually-exclusive with the floating button (since many apps behave that way).
Flag_Default = Flag_AeroSnapWithClientDecos ///> The defaults
};
Q_DECLARE_FLAGS(Flags, Flag)