summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-01-30 00:33:46 +0100
committerGitHub <noreply@github.com>2021-01-30 00:33:46 +0100
commit5930b8eb31e4fd2cc743abbc041f9bd62fdbf0b8 (patch)
tree2e7a7f6fd1deac1b67d4f815bacbabf326169b97 /src
parentTranslated using Weblate (Estonian) (diff)
parentClose user profile dialog on Esc (diff)
downloadnheko-5930b8eb31e4fd2cc743abbc041f9bd62fdbf0b8.tar.xz
Merge pull request #381 from LorenDB/centerUserInfo
Center user info dialog on the screen
Diffstat (limited to 'src')
-rw-r--r--src/MainWindow.h7
-rw-r--r--src/timeline/TimelineViewManager.cpp4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/MainWindow.h b/src/MainWindow.h

index 0915a849..4c365dca 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h
@@ -61,10 +61,15 @@ class MainWindow : public QMainWindow { Q_OBJECT + Q_PROPERTY(int x READ x CONSTANT) + Q_PROPERTY(int y READ y CONSTANT) + Q_PROPERTY(int width READ width CONSTANT) + Q_PROPERTY(int height READ height CONSTANT) + public: explicit MainWindow(QWidget *parent = nullptr); - static MainWindow *instance() { return instance_; }; + static MainWindow *instance() { return instance_; } void saveCurrentWindowSize(); void openLeaveRoomDialog(const QString &room_id); diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index 97af0065..93451976 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp
@@ -128,6 +128,10 @@ TimelineViewManager::TimelineViewManager(CallManager *callManager, ChatPage *par "UserProfile needs to be instantiated on the C++ side"); static auto self = this; + qmlRegisterSingletonType<MainWindow>( + "im.nheko", 1, 0, "MainWindow", [](QQmlEngine *, QJSEngine *) -> QObject * { + return MainWindow::instance(); + }); qmlRegisterSingletonType<TimelineViewManager>( "im.nheko", 1, 0, "TimelineManager", [](QQmlEngine *, QJSEngine *) -> QObject * { return self;