1
0
Fork 0

[UI] Added theme menu item and made switching themes easier.

This commit is contained in:
NamedKitten 2018-12-05 12:05:18 +00:00
parent 6ba9f7fe35
commit c8cf58df5f
5 changed files with 44 additions and 13 deletions

View file

@ -22,6 +22,11 @@ Item {
setControlsTheme(appearance.themeName)
}
Connections {
target: appearance
onThemeNameChanged: setControlsTheme(appearance.themeName)
}
function setControlsTheme(themeName) {
for (var i = 0; i < controlsBar.children.length; ++i) {
if (controlsBar.children[i].objectName == "buttonLayout") {
@ -103,7 +108,9 @@ Item {
Rectangle {
id: controlsBackground
height: controlsBar.visible ? controlsBar.height + (appearance.themeName == "RoosterTeeth" ? 0 : progressBar.topPadding + (fun.nyanCat ? 0 : 1)) : 0
height: controlsBar.visible ? controlsBar.height
+ (appearance.themeName
== "RoosterTeeth" ? 0 : progressBar.topPadding) : 0
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right

View file

@ -459,6 +459,29 @@ MenuBar {
id: viewMenuBarItem
title: translate.getTranslation("VIEW", i18n.language)
CustomMenu {
title: translate.getTranslation("THEME", i18n.language)
id: themeMenu
Action {
text: "YouTube"
onTriggered: appearance.themeName = text
checkable: true
checked: appearance.themeName == text
}
Action {
text: "Niconico"
onTriggered: appearance.themeName = text
checkable: true
checked: appearance.themeName == text
}
Action {
text: "RoosterTeeth"
onTriggered: appearance.themeName = text
checkable: true
checked: appearance.themeName == text
}
}
Action {
text: translate.getTranslation("FULLSCREEN", i18n.language)
onTriggered: {

View file

@ -18,12 +18,12 @@ Button {
appearance.themeName, "buttonColor")
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
display: AbstractButton.IconOnly
onClicked: {
var aptn = appearance.themeName
appearance.themeName = aptn == "YouTube" ? "RoosterTeeth" : aptn
== "RoosterTeeth" ? "Niconico" : "YouTube"
controlsBarItem.setControlsTheme(appearance.themeName)
console.log("Settings Menu Not Yet Implemented.")
}
background: Item {
}

View file

@ -43,7 +43,8 @@ var translations = {
DISABLE_TRACK: "Disable Track",
AUDIO_DEVICES: "Audio Devices",
UPDATE: "Update",
PLAYLIST_MENU: "Playlist Menu"
PLAYLIST_MENU: "Playlist Menu",
THEME: "Theme"
},
spanish: {
SAVE_SCREENSHOT: "Guardar captura en",

View file

@ -54,14 +54,14 @@ Window {
Settings {
id: youTubeAppearance
category: "YouTubeAppearance"
property string mainBackground: "#9C000000"
property string progressBackgroundColor: "#3CFFFFFF"
property string progressCachedColor: "white"
property string buttonColor: "white"
property string buttonHoverColor: "white"
property string progressSliderColor: "red"
property string chapterMarkerColor: "#fc0"
property string volumeSliderBackground: "white"
property color mainBackground: "#9C000000"
property color progressBackgroundColor: "#33FFFFFF"
property color progressCachedColor: "#66FFFFFF"
property color buttonColor: "white"
property color buttonHoverColor: "white"
property color progressSliderColor: "red"
property color chapterMarkerColor: "#fc0"
property color volumeSliderBackground: "white"
}
Settings {
@ -69,7 +69,7 @@ Window {
category: "NicoNicoAppearance"
property string mainBackground: "#9C000000"
property string progressBackgroundColor: "#444"
property string progressCachedColor: "white"
property string progressCachedColor: "#66FFFFFF"
property string buttonColor: "white"
property string buttonHoverColor: "white"
property string progressSliderColor: "#007cff"