From b47acf21382b0d04c5dd72adcf2d894b973ac389 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Sat, 12 Nov 2016 15:49:32 -0800 Subject: [PATCH] add theme support (dark mode) issue #6 --- assets/SettingsPage.qml | 23 +++++++++++++++++++++++ assets/main.qml | 9 +++++++++ translations/Goober.ts | 15 +++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/assets/SettingsPage.qml b/assets/SettingsPage.qml index 4d677ed..67b85c1 100644 --- a/assets/SettingsPage.qml +++ b/assets/SettingsPage.qml @@ -110,6 +110,29 @@ Page { } } Divider {} + Container { + leftPadding: ui.sdu(3) + rightPadding: ui.sdu(3) + DropDown { + title: qsTr("Theme") + Option { + text: qsTr("Bright") + value: VisualStyle.Bright + selected: Application.themeSupport.theme.colorTheme.style == VisualStyle.Bright + } + Option { + text: qsTr("Dark") + value: VisualStyle.Dark + selected: Application.themeSupport.theme.colorTheme.style == VisualStyle.Dark + } + onSelectedOptionChanged: { + _app.setSetting("theme", selectedValue) + Application.themeSupport.setVisualStyle(selectedValue) + } + } + + } + Divider {} // Container { // layout: DockLayout {} // horizontalAlignment: HorizontalAlignment.Fill diff --git a/assets/main.qml b/assets/main.qml index 77d37d3..1138ac3 100644 --- a/assets/main.qml +++ b/assets/main.qml @@ -172,4 +172,13 @@ TabbedPane { } ] + onCreationCompleted: { + var style = _app.setting("theme").toString() + if (style === "1") { + Application.themeSupport.setVisualStyle(VisualStyle.Bright) + } else if (style === "2") { + Application.themeSupport.setVisualStyle(VisualStyle.Dark) + } + } + } diff --git a/translations/Goober.ts b/translations/Goober.ts index 6baa771..db39926 100644 --- a/translations/Goober.ts +++ b/translations/Goober.ts @@ -171,6 +171,21 @@ Additional mentions follow / + + + Theme + + + + + Bright + + + + + Dark + + StreamTab