add theme support (dark mode) issue #6

This commit is contained in:
Morgan McMillian 2016-11-12 15:49:32 -08:00
parent 358f0adddc
commit b47acf2138
3 changed files with 47 additions and 0 deletions

View file

@ -110,6 +110,29 @@ Page {
} }
} }
Divider {} 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 { // Container {
// layout: DockLayout {} // layout: DockLayout {}
// horizontalAlignment: HorizontalAlignment.Fill // horizontalAlignment: HorizontalAlignment.Fill

View file

@ -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)
}
}
} }

View file

@ -171,6 +171,21 @@
<source>Additional mentions follow /</source> <source>Additional mentions follow /</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="../assets/SettingsPage.qml" line="117"/>
<source>Theme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/SettingsPage.qml" line="119"/>
<source>Bright</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/SettingsPage.qml" line="124"/>
<source>Dark</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>StreamTab</name> <name>StreamTab</name>