add ability to override underlay color/opacity regardless of theme
This commit is contained in:
parent
e029732021
commit
a378c999b7
6 changed files with 54 additions and 16 deletions
|
|
@ -221,7 +221,8 @@ const interfaceMod = {
|
|||
customTheme: userThemeSnapshot,
|
||||
customThemeSource: userThemeSource,
|
||||
forceThemeRecompilation,
|
||||
themeDebug
|
||||
themeDebug,
|
||||
theme3hacks
|
||||
} = rootState.config
|
||||
|
||||
const forceRecompile = forceThemeRecompilation || recompile
|
||||
|
|
@ -275,7 +276,36 @@ const interfaceMod = {
|
|||
|
||||
promise
|
||||
.then(realThemeData => {
|
||||
const ruleset = convertTheme2To3(realThemeData)
|
||||
const theme2ruleset = convertTheme2To3(realThemeData)
|
||||
const hacks = []
|
||||
|
||||
Object.entries(theme3hacks).forEach(([key, value]) => {
|
||||
switch (key) {
|
||||
case 'underlay': {
|
||||
if (value !== 'none') {
|
||||
const newRule = {
|
||||
component: 'Underlay',
|
||||
directives: {}
|
||||
}
|
||||
if (value === 'opaque') {
|
||||
newRule.directives.opacity = 1
|
||||
newRule.directives.background = '--wallpaper'
|
||||
}
|
||||
if (value === 'transparent') {
|
||||
newRule.directives.opacity = 0
|
||||
}
|
||||
console.log('NEW RULE', newRule)
|
||||
hacks.push(newRule)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const ruleset = [
|
||||
...theme2ruleset,
|
||||
...hacks
|
||||
]
|
||||
|
||||
applyTheme(
|
||||
ruleset,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue