mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-11 20:16:47 +00:00
fix: show status window in center
This commit is contained in:
parent
9cea54c029
commit
a838753904
@ -2,6 +2,7 @@
|
|||||||
#define STATUSWINDOW_H
|
#define STATUSWINDOW_H
|
||||||
|
|
||||||
#include <QQuickWindow>
|
#include <QQuickWindow>
|
||||||
|
#include <QScreen>
|
||||||
|
|
||||||
class StatusWindow: public QQuickWindow
|
class StatusWindow: public QQuickWindow
|
||||||
{
|
{
|
||||||
@ -17,6 +18,13 @@ public:
|
|||||||
|
|
||||||
bool isFullScreen() const;
|
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:
|
signals:
|
||||||
void isFullScreenChanged();
|
void isFullScreenChanged();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user