mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-06 17:53:34 +00:00
fix: show status window in center
This commit is contained in:
parent
9cea54c029
commit
a838753904
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user