From aa7a3361833f4c88ec685c4a92ff7727ed7249a7 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 12 Sep 2024 19:31:19 +0300 Subject: [PATCH] Updated shadow control to be able to handle "absolute null" situation --- .../tabs/theme_tab/theme_tab.js | 14 +- .../tabs/theme_tab/theme_tab.vue | 46 +------ .../shadow_control/shadow_control.js | 122 ++++++++++-------- .../shadow_control/shadow_control.scss | 17 ++- .../shadow_control/shadow_control.vue | 103 +++++++++++---- src/i18n/en.json | 1 + src/services/theme_data/theme_data.service.js | 2 +- 7 files changed, 179 insertions(+), 126 deletions(-) diff --git a/src/components/settings_modal/tabs/theme_tab/theme_tab.js b/src/components/settings_modal/tabs/theme_tab/theme_tab.js index 25836559..a295e880 100644 --- a/src/components/settings_modal/tabs/theme_tab/theme_tab.js +++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.js @@ -314,7 +314,18 @@ export default { }, set (val) { if (val) { - this.shadowsLocal[this.shadowSelected] = this.currentShadowFallback.map(_ => Object.assign({}, _)) + this.shadowsLocal[this.shadowSelected] = (this.currentShadowFallback || []) + .map(s => ({ + name: null, + x: 0, + y: 0, + blur: 0, + spread: 0, + inset: false, + color: '#000000', + alpha: 1, + ...s + })) } else { delete this.shadowsLocal[this.shadowSelected] } @@ -328,6 +339,7 @@ export default { return this.shadowsLocal[this.shadowSelected] }, set (v) { + console.log('TT', v) this.shadowsLocal[this.shadowSelected] = v } }, diff --git a/src/components/settings_modal/tabs/theme_tab/theme_tab.vue b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue index d975c61d..00a55832 100644 --- a/src/components/settings_modal/tabs/theme_tab/theme_tab.vue +++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue @@ -937,24 +937,14 @@
- - {{ ' ' }} - -
@@ -141,11 +145,12 @@
diff --git a/src/i18n/en.json b/src/i18n/en.json index b27c36d7..1b67d4f7 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -880,6 +880,7 @@ "filter_hint": { "always_drop_shadow": "Warning, this shadow always uses {0} when browser supports it.", "drop_shadow_syntax": "{0} does not support {1} parameter and {2} keyword.", + "avatar_inset_short": "Separate inset shadow", "avatar_inset": "Please note that combining both inset and non-inset shadows on avatars might give unexpected results with transparent avatars.", "spread_zero": "Shadows with spread > 0 will appear as if it was set to zero", "inset_classic": "Inset shadows will be using {0}" diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index 2dddfa04..ef7ec645 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -452,7 +452,7 @@ export const getCssShadow = (input, usesDropShadow) => { ]).join(' ')).join(', ') } -const getCssShadowFilter = (input) => { +export const getCssShadowFilter = (input) => { if (input.length === 0) { return 'none' }