aboutsummaryrefslogtreecommitdiffstats
path: root/Config
diff options
context:
space:
mode:
Diffstat (limited to 'Config')
-rw-r--r--Config/CMakeLists.txt13
-rw-r--r--Config/Config.qml23
-rw-r--r--Config/qmldir2
3 files changed, 38 insertions, 0 deletions
diff --git a/Config/CMakeLists.txt b/Config/CMakeLists.txt
new file mode 100644
index 0000000..fe5abec
--- /dev/null
+++ b/Config/CMakeLists.txt
@@ -0,0 +1,13 @@
+qt_add_library(Config STATIC)
+
+set_source_files_properties(Config.qml
+ PROPERTIES
+ QT_QML_SINGLETON_TYPE true
+)
+
+qt_add_qml_module(Config
+ URI "Config"
+ OUTPUT_DIRECTORY Config
+ QML_FILES
+ "Config.qml"
+)
diff --git a/Config/Config.qml b/Config/Config.qml
new file mode 100644
index 0000000..41da703
--- /dev/null
+++ b/Config/Config.qml
@@ -0,0 +1,23 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// Copyright (C) 2024 Automotive Grade Linux
+// SPDX-License-Identifier: GPL-3.0+
+
+pragma Singleton
+import QtQuick
+
+QtObject {
+ enum Theme {
+ Light,
+ Dark
+ }
+
+ property int activeTheme : Config.Theme.Dark
+
+ readonly property bool isMobileTarget : Qt.platform.os === "android" || Qt.platform.os === "ios"
+ readonly property color mainColor : activeTheme ? "#09102B" : "#FFFFFF"
+ readonly property color secondaryColor : activeTheme ? "#FFFFFF" : "#09102B"
+
+ function iconSource(fileName, addSuffix = true) {
+ return `qrc:/qt/qml/MediaControls/icons/${fileName}${activeTheme === Config.Theme.Dark && addSuffix ? "_Dark.svg" : ".svg"}`
+ }
+}
diff --git a/Config/qmldir b/Config/qmldir
new file mode 100644
index 0000000..d206828
--- /dev/null
+++ b/Config/qmldir
@@ -0,0 +1,2 @@
+module Config
+singleton Config 1.0 Config.qml