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:
@@ -27,6 +27,7 @@
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWindowStateChangeEvent>
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
|
||||
@@ -51,6 +52,14 @@ void FloatingWindowWidget::paintEvent(QPaintEvent *)
|
||||
p.drawRect(rect().adjusted(0, 0, -1, -1));
|
||||
}
|
||||
|
||||
bool FloatingWindowWidget::event(QEvent *ev)
|
||||
{
|
||||
if (ev->type() == QEvent::WindowStateChange)
|
||||
Q_EMIT windowStateChanged(static_cast<QWindowStateChangeEvent*>(ev));
|
||||
|
||||
return FloatingWindow::event(ev);
|
||||
}
|
||||
|
||||
void FloatingWindowWidget::init()
|
||||
{
|
||||
m_vlayout->setSpacing(0);
|
||||
|
||||
Reference in New Issue
Block a user