fix: show status window in center

This commit is contained in:
B.Melnik 2021-07-19 15:56:43 +03:00 committed by Iuri Matias
parent 9cea54c029
commit a838753904

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();