From b106eafb0edab2e596a997592e75a81396f8f36c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 12 Jan 2022 19:09:46 +0100 Subject: Initial qml root window --- src/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 2ae631cf..af8a46a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -279,6 +280,7 @@ main(int argc, char *argv[]) font.setPointSizeF(settings.lock()->fontSize()); app.setFont(font); + settings.lock()->applyTheme(); if (QLocale().language() == QLocale::C) QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedKingdom)); @@ -296,15 +298,16 @@ main(int argc, char *argv[]) app.installTranslator(&appTranslator); MainWindow w; + // QQuickView w; // Move the MainWindow to the center - w.move(screenCenter(w.width(), w.height())); + // w.move(screenCenter(w.width(), w.height())); if (!(settings.lock()->startInTray() && settings.lock()->tray())) w.show(); QObject::connect(&app, &QApplication::aboutToQuit, &w, [&w]() { - w.saveCurrentWindowSize(); + // w.saveCurrentWindowSize(); if (http::client() != nullptr) { nhlog::net()->debug("shutting down all I/O threads & open connections"); http::client()->close(true); @@ -314,7 +317,7 @@ main(int argc, char *argv[]) QObject::connect(&app, &SingleApplication::instanceStarted, &w, [&w]() { w.show(); w.raise(); - w.activateWindow(); + w.requestActivate(); }); // It seems like handling the message in a blocking manner is a no-go. I have no idea how to -- cgit 1.5.1 From 1d6d9e65af7b78cb9fa1b68238f1b488b085ddfd Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 29 Jan 2022 18:10:42 +0100 Subject: Store window size on exit again --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index af8a46a9..24fc8415 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -307,7 +307,7 @@ main(int argc, char *argv[]) w.show(); QObject::connect(&app, &QApplication::aboutToQuit, &w, [&w]() { - // w.saveCurrentWindowSize(); + w.saveCurrentWindowSize(); if (http::client() != nullptr) { nhlog::net()->debug("shutting down all I/O threads & open connections"); http::client()->close(true); -- cgit 1.5.1