fix: show status window in center

This commit is contained in:
B.Melnik 2021-07-19 15:56:43 +03:00 committed by Michał
parent d62b8ee921
commit 0d4916d033
1 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#define STATUSWINDOW_H
#include <QQuickWindow>
#include <QScreen>
class StatusWindow: public QQuickWindow
{
@ -17,6 +18,13 @@ public:
bool isFullScreen() const;
Q_INVOKABLE void updatePosition() {
auto point = QPoint(screen()->geometry().center().x() - geometry().width() / 2, screen()->geometry().center().y() - geometry().height() / 2);
if (point != this->position()) {
this->setPosition(point);
}
}
signals:
void isFullScreenChanged();