summary refs log tree commit diff
path: root/src/main.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-11-25 18:19:58 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-11-25 18:19:58 +0200
commitf0ecf6eee6d6c9270f2e21f4f57af3f91044bd6c (patch)
tree362b97bd8b3e1a44b373a28efaa6ef67207e5ed9 /src/main.cc
parentUpdate system theme (diff)
downloadnheko-f0ecf6eee6d6c9270f2e21f4f57af3f91044bd6c.tar.xz
Add dark theme
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main.cc b/src/main.cc

index 9ca1d5de..7338e578 100644 --- a/src/main.cc +++ b/src/main.cc
@@ -75,15 +75,25 @@ main(int argc, char *argv[]) QFile stylefile; - if (!settings.contains("user/theme")) { - settings.setValue("user/theme", "default"); - } + if (!settings.contains("user/theme")) + settings.setValue("user/theme", "light"); + + const auto theme = settings.value("user/theme", "light").toString(); + + QPalette pal; - if (settings.value("user/theme").toString() == "default") { + if (theme == "light") { stylefile.setFileName(":/styles/styles/nheko.qss"); + pal.setColor(QPalette::Link, QColor("#333")); + } else if (theme == "dark") { + stylefile.setFileName(":/styles/styles/nheko-dark.qss"); + pal.setColor(QPalette::Link, QColor("#d7d9dc")); } else { stylefile.setFileName(":/styles/styles/system.qss"); } + + app.setPalette(pal); + stylefile.open(QFile::ReadOnly); QString stylesheet = QString(stylefile.readAll());