2022-01-06 19:29:19 +00:00
|
|
|
#include "StatusWindow.h"
|
|
|
|
|
2022-02-21 18:03:38 +00:00
|
|
|
StatusWindow::StatusWindow(QWindow* parent)
|
|
|
|
: QQuickWindow(parent)
|
|
|
|
, m_isFullScreen(false)
|
2022-01-06 19:29:19 +00:00
|
|
|
{
|
|
|
|
removeTitleBar();
|
|
|
|
|
|
|
|
connect(this, &QQuickWindow::windowStateChanged, [&](Qt::WindowState windowState) {
|
2022-02-21 18:03:38 +00:00
|
|
|
if(windowState == Qt::WindowNoState)
|
|
|
|
{
|
2022-01-06 19:29:19 +00:00
|
|
|
removeTitleBar();
|
|
|
|
m_isFullScreen = false;
|
|
|
|
emit isFullScreenChanged();
|
2022-02-21 18:03:38 +00:00
|
|
|
}
|
|
|
|
else if(windowState == Qt::WindowFullScreen)
|
|
|
|
{
|
2022-01-06 19:29:19 +00:00
|
|
|
m_isFullScreen = true;
|
|
|
|
emit isFullScreenChanged();
|
|
|
|
showTitleBar();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void StatusWindow::toggleFullScreen()
|
|
|
|
{
|
2022-02-21 18:03:38 +00:00
|
|
|
if(m_isFullScreen)
|
|
|
|
{
|
2022-01-06 19:29:19 +00:00
|
|
|
showNormal();
|
2022-02-21 18:03:38 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-01-06 19:29:19 +00:00
|
|
|
showFullScreen();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool StatusWindow::isFullScreen() const
|
|
|
|
{
|
2022-02-21 18:03:38 +00:00
|
|
|
return m_isFullScreen;
|
2022-01-06 19:29:19 +00:00
|
|
|
}
|