From 3113219241f95118b8a4cb116d352be1d48112a8 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 30 Apr 2019 10:53:09 +0200 Subject: [PATCH 1/2] themeChanged send the full theme object --- src/app/tabs/theme-module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/theme-module.js b/src/app/tabs/theme-module.js index 7993f190bf..f2091c5198 100644 --- a/src/app/tabs/theme-module.js +++ b/src/app/tabs/theme-module.js @@ -57,6 +57,6 @@ export class ThemeModule extends BaseApi { document.getElementById('theme-link').setAttribute('href', nextTheme.url) document.documentElement.style.setProperty('--theme', nextTheme.quality) if (themeName) this.active = themeName - this.events.emit('themeChanged', nextTheme.quality) + this.events.emit('themeChanged', nextTheme) } } From 6de2c68fb6400fbe4e205970471d5d2bb110d511 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 30 Apr 2019 13:00:25 +0200 Subject: [PATCH 2/2] `themeChanged` uses an object instead of "light" or "dark" --- src/app/components/vertical-icons-component.js | 4 ++-- src/app/editor/editor.js | 4 ++-- src/app/ui/landing-page/landing-page.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index 9e01f33856..0d6a44743e 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -35,8 +35,8 @@ class VerticalIconComponent { this.store.event.on('remove', (api) => { }) let themeModule = globalRegistry.get('themeModule').api - themeModule.events.on('themeChanged', (type) => { - this.onThemeChanged(type) + themeModule.events.on('themeChanged', (theme) => { + this.onThemeChanged(theme.quality) }) } diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index 87ca2faa01..34d32a8a77 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -52,8 +52,8 @@ class Editor { 'light': 'chrome', 'dark': 'chaos' } - this._deps.themeModule.events.on('themeChanged', (type) => { - this.setTheme(type) + this._deps.themeModule.events.on('themeChanged', (theme) => { + this.setTheme(theme.quality) }) // Init diff --git a/src/app/ui/landing-page/landing-page.js b/src/app/ui/landing-page/landing-page.js index 340c6cb76b..97651c63e9 100644 --- a/src/app/ui/landing-page/landing-page.js +++ b/src/app/ui/landing-page/landing-page.js @@ -161,8 +161,8 @@ export class LandingPage extends BaseApi { globalRegistry.get('verticalicon').api.select('fileExplorers') } - globalRegistry.get('themeModule').api.events.on('themeChanged', (type) => { - const invert = type === 'dark' ? 1 : 0 + globalRegistry.get('themeModule').api.events.on('themeChanged', (theme) => { + const invert = theme.quality === 'dark' ? 1 : 0 const img = document.getElementById('remixLogo') if (img) { img.style.filter = `invert(${invert})`