55#include < qqmllist.h>
66#include < qtmetamacros.h>
77#include < qtypes.h>
8+ #include < qwindow.h>
89
910#include " proxywindow.hpp"
1011#include " windowinterface.hpp"
@@ -55,6 +56,7 @@ FloatingWindowInterface::FloatingWindowInterface(QObject* parent)
5556 QObject::connect (this ->window , &ProxyFloatingWindow::titleChanged, this , &FloatingWindowInterface::titleChanged);
5657 QObject::connect (this ->window , &ProxyFloatingWindow::minimumSizeChanged, this , &FloatingWindowInterface::minimumSizeChanged);
5758 QObject::connect (this ->window , &ProxyFloatingWindow::maximumSizeChanged, this , &FloatingWindowInterface::maximumSizeChanged);
59+ QObject::connect (this ->window , &ProxyWindowBase::windowVisibilityChanged, this , &FloatingWindowInterface::onVisibilityChanged);
5860 // clang-format on
5961}
6062
@@ -66,3 +68,52 @@ void FloatingWindowInterface::onReload(QObject* oldInstance) {
6668}
6769
6870ProxyWindowBase* FloatingWindowInterface::proxyWindow () const { return this ->window ; }
71+
72+ void FloatingWindowInterface::onVisibilityChanged () {
73+ auto * qw = this ->window ->backingWindow ();
74+ auto visibility = qw ? qw->visibility () : QWindow::Hidden;
75+
76+ auto maximized = visibility == QWindow::Maximized;
77+ auto fullscreen = visibility == QWindow::FullScreen;
78+
79+ if (maximized != this ->mMaximized ) {
80+ this ->mMaximized = maximized;
81+ emit this ->maximizedChanged ();
82+ }
83+
84+ if (fullscreen != this ->mFullscreen ) {
85+ this ->mFullscreen = fullscreen;
86+ emit this ->fullscreenChanged ();
87+ }
88+ }
89+
90+ bool FloatingWindowInterface::maximized () const { return this ->mMaximized ; }
91+ bool FloatingWindowInterface::fullscreen () const { return this ->mFullscreen ; }
92+
93+ bool FloatingWindowInterface::startSystemMove () const {
94+ auto * qw = this ->window ->backingWindow ();
95+ if (!qw) return false ;
96+ return qw->startSystemMove ();
97+ }
98+
99+ bool FloatingWindowInterface::startSystemResize (Qt::Edges edges) const {
100+ auto * qw = this ->window ->backingWindow ();
101+ if (!qw) return false ;
102+ return qw->startSystemResize (edges);
103+ }
104+
105+ void FloatingWindowInterface::showNormal () const {
106+ if (auto * qw = this ->window ->backingWindow ()) qw->showNormal ();
107+ }
108+
109+ void FloatingWindowInterface::showMaximized () const {
110+ if (auto * qw = this ->window ->backingWindow ()) qw->showMaximized ();
111+ }
112+
113+ void FloatingWindowInterface::showMinimized () const {
114+ if (auto * qw = this ->window ->backingWindow ()) qw->showMinimized ();
115+ }
116+
117+ void FloatingWindowInterface::showFullScreen () const {
118+ if (auto * qw = this ->window ->backingWindow ()) qw->showFullScreen ();
119+ }
0 commit comments