add theme support (dark mode) issue #6
This commit is contained in:
parent
358f0adddc
commit
b47acf2138
3 changed files with 47 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -171,6 +171,21 @@
|
|||
<source>Additional mentions follow /</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</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>
|
||||
<name>StreamTab</name>
|
||||
|
|
Reference in a new issue