refactor(sandbox): rely on global `Theme` instead of theme prop

This commit is contained in:
Pascal Precht 2021-05-20 11:35:25 +02:00 committed by Michał Cieślak
parent 6211ebcf66
commit 9f6f36f571
5 changed files with 2 additions and 11 deletions

View File

@ -9,7 +9,6 @@ GridLayout {
columns: 6 columns: 6
columnSpacing: 5 columnSpacing: 5
rowSpacing: 5 rowSpacing: 5
property ThemePalette theme
StatusIconTabButton { StatusIconTabButton {
icon.name: "chat" icon.name: "chat"

View File

@ -11,7 +11,6 @@ GridLayout {
columns: 6 columns: 6
columnSpacing: 5 columnSpacing: 5
rowSpacing: 5 rowSpacing: 5
property ThemePalette theme
Button { Button {
id: btn id: btn

View File

@ -8,10 +8,9 @@ GridLayout {
columns: 6 columns: 6
columnSpacing: 5 columnSpacing: 5
rowSpacing: 5 rowSpacing: 5
property ThemePalette theme
StatusLoadingIndicator { StatusLoadingIndicator {
color: parent.theme.directColor4 color: Theme.palette.directColor4
} }
StatusLetterIdenticon { StatusLetterIdenticon {

View File

@ -175,7 +175,6 @@ StatusWindow {
id: controlsComponent id: controlsComponent
Controls { Controls {
anchors.centerIn: parent anchors.centerIn: parent
theme: Theme.palette
} }
} }
@ -183,7 +182,6 @@ StatusWindow {
id: layoutComponent id: layoutComponent
Layout { Layout {
anchors.centerIn: parent anchors.centerIn: parent
theme: Theme.palette
} }
} }
@ -191,7 +189,6 @@ StatusWindow {
id: othersComponent id: othersComponent
Others { Others {
anchors.centerIn: parent anchors.centerIn: parent
theme: Theme.palette
} }
} }

View File

@ -4,10 +4,7 @@ import QtQuick 2.13
QtObject { QtObject {
id: appTheme id: appTheme
// Replace it with: property QtObject palette: StatusLightTheme {}
// property QtObject palette: StatusLightTheme {}
// for reloading
property ThemePalette palette: StatusLightTheme {}
function setTheme(theme) { function setTheme(theme) {
palette = theme palette = theme