From 097c149a3ca27e93b82c22ee4f32662da56a4aad Mon Sep 17 00:00:00 2001 From: Michael Ehrenreich Date: Wed, 15 Feb 2023 02:20:35 +0100 Subject: [PATCH] Merge main-dev.qml and main.qml --- main-dev.qml | 5 ----- main.cpp | 6 ++++-- main.qml | 7 ++++++- 3 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 main-dev.qml diff --git a/main-dev.qml b/main-dev.qml deleted file mode 100644 index 8315536..0000000 --- a/main-dev.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick - -LightControlWindow { - visible: true -} diff --git a/main.cpp b/main.cpp index 0baeb77..214e0c8 100644 --- a/main.cpp +++ b/main.cpp @@ -47,9 +47,11 @@ int main(int argc, char *argv[]) QQmlApplicationEngine engine; - engine.rootContext()->setContextProperty("__controller", &controller); - const QUrl url{windowed ? u"qrc:/lightcontrol/main-dev.qml"_qs : u"qrc:/lightcontrol/main.qml"_qs}; + engine.rootContext()->setContextProperty("__controller", &controller); + engine.rootContext()->setContextProperty("__windowed", windowed); + + const QUrl url{u"qrc:/lightcontrol/main.qml"_qs}; QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) diff --git a/main.qml b/main.qml index f698687..ec93535 100644 --- a/main.qml +++ b/main.qml @@ -1,5 +1,10 @@ import QtQuick LightControlWindow { - Component.onCompleted: showFullScreen() + Component.onCompleted: { + if (__windowed) + showNormal(); + else + showFullScreen(); + } }