mirror of
https://github.com/stemoretti/BaseUI.git
synced 2025-05-25 07:10:23 -04:00
Change Style.theme type to string
This commit is contained in:
parent
287d439eec
commit
768bb75de4
@ -294,22 +294,17 @@ UI.App {
|
||||
id: themeDialog
|
||||
|
||||
title: "Choose theme style"
|
||||
model: [
|
||||
{ name: "Dark", style: Material.Dark },
|
||||
{ name: "Light", style: Material.Light },
|
||||
{ name: "System", style: Material.System }
|
||||
]
|
||||
model: [ "Dark", "Light", "System" ]
|
||||
delegate: RowLayout {
|
||||
spacing: 0
|
||||
|
||||
RadioButton {
|
||||
checked: modelData.name === root.themeStyle
|
||||
text: modelData.name
|
||||
checked: modelData === root.themeStyle
|
||||
text: modelData
|
||||
Layout.leftMargin: 4
|
||||
onClicked: {
|
||||
themeDialog.close()
|
||||
root.themeStyle = modelData.name
|
||||
UI.Style.theme = modelData.style
|
||||
root.themeStyle = modelData
|
||||
root.theme = root.Material.theme === Material.Dark
|
||||
}
|
||||
}
|
||||
@ -395,5 +390,6 @@ UI.App {
|
||||
UI.Style.primaryColor = Qt.binding(function() { return root.primary })
|
||||
UI.Style.accentColor = Qt.binding(function() { return root.accent })
|
||||
UI.Style.isDarkTheme = Qt.binding(function() { return root.theme })
|
||||
UI.Style.theme = Qt.binding(function() { return root.themeStyle })
|
||||
}
|
||||
}
|
||||
|
@ -23,5 +23,7 @@ ApplicationWindow {
|
||||
|
||||
Material.primary: Style.primaryColor
|
||||
Material.accent: Style.accentColor
|
||||
Material.theme: Style.theme
|
||||
Material.theme: Style.theme == "System"
|
||||
? Material.System
|
||||
: (Style.theme == "Dark" ? Material.Dark : Material.Light)
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import QtQuick.Controls.Material
|
||||
|
||||
QtObject {
|
||||
property bool isDarkTheme: false
|
||||
property int theme: Material.System
|
||||
property string theme: "System"
|
||||
property bool toolBarPrimary: true
|
||||
|
||||
property color primaryColor: Material.color(Material.BlueGrey)
|
||||
|
Loading…
Reference in New Issue
Block a user