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

@@ -59,6 +59,7 @@ protected:
void mouseDoubleClickEvent(QMouseEvent *) override;
void updateFloatButton() override;
void updateCloseButton() override;
void updateMaximizeButton() override;
// The following are needed for the unit-tests
bool isCloseButtonVisible() const override;
@@ -75,6 +76,7 @@ private:
QHBoxLayout *const m_layout;
QAbstractButton *m_closeButton = nullptr;
QAbstractButton *m_floatButton = nullptr;
QAbstractButton *m_maximizeButton = nullptr;
QLabel *m_dockWidgetIcon = nullptr;
};