From 024adfe49c3a023dd95b3d30d2ab18cc0a7d9c72 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 13 Jul 2022 13:02:39 +0300 Subject: [PATCH] [all] fix support for new theme in editors --- apps/common/main/lib/controller/Themes.js | 6 ++++++ apps/common/main/lib/util/htmlutils.js | 10 ++++++---- .../resources/less/colors-table-dark-contrast.less | 2 +- apps/documenteditor/main/index.html | 2 +- apps/documenteditor/main/locale/en.json | 1 + apps/documenteditor/main/resources/less/app.less | 1 + apps/presentationeditor/main/index.html | 2 +- apps/presentationeditor/main/index.reporter.html | 2 +- apps/presentationeditor/main/index_loader.html | 2 +- apps/presentationeditor/main/locale/en.json | 1 + apps/presentationeditor/main/resources/less/app.less | 1 + apps/spreadsheeteditor/main/index.html | 2 +- apps/spreadsheeteditor/main/locale/en.json | 1 + apps/spreadsheeteditor/main/resources/less/app.less | 1 + 14 files changed, 24 insertions(+), 10 deletions(-) diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index 7ed8051ad..86e1d4ec5 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -36,6 +36,11 @@ define([ type: 'dark', source: 'static', }, + 'theme-contrast-dark': { + text: locale.txtThemeContrastDark || 'Dark Contrast', + type: 'dark', + source: 'static', + }, } if ( !!window.currentLoaderTheme ) { @@ -118,6 +123,7 @@ define([ "canvas-page-border", "canvas-ruler-background", + "canvas-ruler-border", "canvas-ruler-margins-background", "canvas-ruler-mark", "canvas-ruler-handle-border", diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index ba77f887a..57a1e04ca 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -93,10 +93,12 @@ if ( !!ui_theme_name ) { } if ( checkLocalStorage ) { - var content_theme = localStorage.getItem("content-theme"); - if ( content_theme == 'dark' ) { - var current_theme = localStorage.getItem("ui-theme"); - if ( !!current_theme && /type":\s*"dark/.test(current_theme) ) { + let current_theme = localStorage.getItem("ui-theme"); + if ( !!current_theme && /type":\s*"dark/.test(current_theme) ) { + document.body.classList.add("theme-type-dark"); + + let content_theme = localStorage.getItem("content-theme"); + if ( content_theme == 'dark' ) { document.body.classList.add("content-theme-dark"); } } diff --git a/apps/common/main/resources/less/colors-table-dark-contrast.less b/apps/common/main/resources/less/colors-table-dark-contrast.less index 34960b4a0..4cf865894 100644 --- a/apps/common/main/resources/less/colors-table-dark-contrast.less +++ b/apps/common/main/resources/less/colors-table-dark-contrast.less @@ -1,6 +1,6 @@ :root { - .theme-dark-contrast { + .theme-contrast-dark { --toolbar-header-document: #1e1e1e; --toolbar-header-spreadsheet: #1e1e1e; --toolbar-header-presentation: #1e1e1e; diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html index 6b57c5161..f6a75831c 100644 --- a/apps/documenteditor/main/index.html +++ b/apps/documenteditor/main/index.html @@ -10,7 +10,7 @@