summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-09-24 21:56:59 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-10-06 18:38:22 +0200
commit21ef2eb0534aa28cc47f062df9655f64881bee95 (patch)
tree156444609209d0a5ba0a5ba06d631bb65dd8cca8
parent3234cdbd265a75182df1614c125707149d6c8e0b (diff)
[ui] use configuration file
-rw-r--r--gui/components/Preferences.qml5
-rw-r--r--gui/gui.qrc1
-rw-r--r--gui/main.cpp6
-rw-r--r--gui/qtquickcontrols2.conf6
4 files changed, 15 insertions, 3 deletions
diff --git a/gui/components/Preferences.qml b/gui/components/Preferences.qml
index 3620471..720454b 100644
--- a/gui/components/Preferences.qml
+++ b/gui/components/Preferences.qml
@@ -9,8 +9,9 @@ ThemedPage {
Column {
id: prefCol
- // FIXME the checkboxes seem to have a bigger lineHeight themselves, need to pack more.
- spacing: 1
+ // FIXME checkboxes in Material style force lineHeights too big.
+ // need to override the style
+ // See: https://bugreports.qt.io/browse/QTBUG-95385
topPadding: root.width * 0.05
leftPadding: root.width * 0.1
rightPadding: root.width * 0.15
diff --git a/gui/gui.qrc b/gui/gui.qrc
index 67da45c..e4d1cd6 100644
--- a/gui/gui.qrc
+++ b/gui/gui.qrc
@@ -2,6 +2,7 @@
<qresource prefix="/">
<file>main.qml</file>
+ <file>qtquickcontrols2.conf</file>
<!-- gui components -->
<file>themes/themes.js</file>
diff --git a/gui/main.cpp b/gui/main.cpp
index d136c3c..be1be0a 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -173,6 +173,7 @@ int main(int argc, char **argv) {
QJsonModel *model = new QJsonModel;
+ // FIXME use qgetenv
QString desktop = QString::fromStdString(getEnv("XDG_CURRENT_DESKTOP"));
QString debug = QString::fromStdString(getEnv("DEBUG"));
@@ -190,7 +191,10 @@ int main(int argc, char **argv) {
ctx->setContextProperty("systrayAvailable", availableSystray);
ctx->setContextProperty("qmlDebug", debug == "1");
- QQuickStyle::setStyle("Material");
+ //XXX we're doing configuration via config file, but this is a mechanism
+ //to change to Dark Theme if desktop has it.
+ //qputenv("QT_QUICK_CONTROLS_MATERIAL_VARIANT", "Dense");
+ //QQuickStyle::setStyle("Material");
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
/* connect the jsonChanged signal explicitely.
diff --git a/gui/qtquickcontrols2.conf b/gui/qtquickcontrols2.conf
new file mode 100644
index 0000000..1e387cc
--- /dev/null
+++ b/gui/qtquickcontrols2.conf
@@ -0,0 +1,6 @@
+[Controls]
+Style=Material
+
+[Material]
+Theme=Light
+Variant=Dense