From f9e407de639ce4d20beacd3eca3501639ae161bd Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 21 Jun 2024 23:28:24 +0300 Subject: [PATCH] made theme debug easier by making it an actual option --- src/boot/after_store.js | 10 ++++++---- .../settings_modal/tabs/appearance_tab.vue | 16 ++++++++++++++++ .../settings_modal/tabs/general_tab.vue | 8 -------- src/i18n/en.json | 1 + src/modules/config.js | 12 ++++++++++-- src/modules/instance.js | 6 +++--- src/services/style_setter/style_setter.js | 17 +++++++++++------ src/services/theme_data/css_utils.js | 12 +++++------- src/services/theme_data/theme_data_3.service.js | 2 +- 9 files changed, 53 insertions(+), 31 deletions(-) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index bcab7a66..b93e28a3 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -353,18 +353,20 @@ const afterStoreSetup = async ({ store, i18n }) => { await setConfig({ store }) - const { customTheme, customThemeSource, forceThemeRecompilation } = store.state.config + const { customTheme, customThemeSource, forceThemeRecompilation, themeDebug } = store.state.config const { theme } = store.state.instance const customThemePresent = customThemeSource || customTheme - if (!forceThemeRecompilation && tryLoadCache()) { + console.log('DEBUG INITIAL', themeDebug, forceThemeRecompilation) + + if (!forceThemeRecompilation && !themeDebug && tryLoadCache()) { store.commit('setThemeApplied') } else { if (customThemePresent) { if (customThemeSource && customThemeSource.themeEngineVersion === CURRENT_VERSION) { - applyTheme(customThemeSource) + applyTheme(customThemeSource, () => {}, themeDebug) } else { - applyTheme(customTheme) + applyTheme(customTheme, () => {}, themeDebug) } store.commit('setThemeApplied') } else if (theme) { diff --git a/src/components/settings_modal/tabs/appearance_tab.vue b/src/components/settings_modal/tabs/appearance_tab.vue index dd9e8070..5356292e 100644 --- a/src/components/settings_modal/tabs/appearance_tab.vue +++ b/src/components/settings_modal/tabs/appearance_tab.vue @@ -142,6 +142,22 @@ {{ $t('settings.hide_wallpaper') }} +
  • + + {{ $t('settings.force_theme_recompilation_debug') }} + +
  • +
  • + + {{ $t('settings.theme_debug') }} + +
  • diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 496d0d56..4ece6cf4 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -148,14 +148,6 @@

    {{ $t('settings.post_look_feel') }}