diff --git a/apps/common/main/lib/controller/TabStyler.js b/apps/common/main/lib/controller/TabStyler.js index 85f954dbb2..4e69435c93 100644 --- a/apps/common/main/lib/controller/TabStyler.js +++ b/apps/common/main/lib/controller/TabStyler.js @@ -53,7 +53,9 @@ define([ var value = Common.UI.FeaturesManager.getInitValue('tabStyle', true); if ( _canChangeStyle && Common.localStorage.itemExists("settings-tab-style")) { // get from local storage - value = Common.localStorage.getItem("settings-tab-style"); + var themeid = Common.UI.Themes.currentThemeId(), + isNew = themeid==='theme-system' || themeid==='theme-white' || themeid==='theme-night'; + value = isNew && !Common.localStorage.itemExists("settings-tab-style-newtheme") ? 'line' : Common.localStorage.getItem("settings-tab-style"); } else if (value === undefined) { value = (_customization && (typeof _customization === 'object') && _customization.toolbarNoTabs) ? 'line' : Common.UI.Themes.getThemeProps('tab-style'); } @@ -106,7 +108,9 @@ define([ } else { style = Common.UI.FeaturesManager.getInitValue('tabStyle', true); if ( _canChangeStyle && Common.localStorage.itemExists("settings-tab-style")) { // get from local storage - style = Common.localStorage.getItem("settings-tab-style"); + var themeid = Common.UI.Themes.currentThemeId(), + isNew = themeid==='theme-system' || themeid==='theme-white' || themeid==='theme-night'; + style = isNew && !Common.localStorage.itemExists("settings-tab-style-newtheme") ? 'line' : Common.localStorage.getItem("settings-tab-style"); } else if (style === undefined) { style = (_customization && (typeof _customization === 'object') && _customization.toolbarNoTabs) ? 'line' : Common.UI.Themes.getThemeProps('tab-style'); } diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index d249173d8e..e1b062d432 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -172,6 +172,7 @@ if ( !window.uitheme.id && !!params.uitheme ) { window.uitheme.adapt_to_system_theme(); } else { window.uitheme.id = params.uitheme; + window.uitheme.type = params.uithemetype; } } diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index da64130c02..d6ff09fd6e 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -1104,12 +1104,6 @@ define([ setBranding: function (value, config) { this.branding = value; var element = $('#header-logo'); - if (value && value.logo && (value.logo.image || value.logo.imageDark || value.logo.imageLight)) { // TODO: remove - let str = "static/images/logo/docseditor.svg"; - if (value.logo.image && value.logo.image.indexOf(str)>-1 || value.logo.imageDark && value.logo.imageDark.indexOf(str)>-1 || value.logo.imageLight && value.logo.imageLight.indexOf(str)>-1) - value.logo.image = value.logo.imageDark = value.logo.imageLight = undefined; - } - var logo = this.getSuitableLogo(value, config); element.toggleClass('logo-light', logo.isLight); if ( value && value.logo && element) { diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 3985cc5b39..befcce86f5 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -890,12 +890,6 @@ define([ return; } - if (value.logo.image || value.logo.imageDark || value.logo.imageLight) { // TODO: remove - let str = "static/images/logo/docseditor.svg"; - if (value.logo.image && value.logo.image.indexOf(str)>-1 || value.logo.imageDark && value.logo.imageDark.indexOf(str)>-1 || value.logo.imageLight && value.logo.imageLight.indexOf(str)>-1) - value.logo.image = value.logo.imageDark = value.logo.imageLight = undefined; - } - if (value.logo.image || value.logo.imageDark || value.logo.imageLight) { _logoImage = Common.UI.Themes.isDarkTheme() ? (value.logo.imageDark || value.logo.image || value.logo.imageLight) : (value.logo.imageLight || value.logo.image || value.logo.imageDark); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 4b3784e519..6a56f8d27c 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -850,6 +850,8 @@ define([], function () { dataHint: '2', dataHintDirection: 'bottom', dataHintOffset: 'big' + }).on('selected', function(combo, record) { + me._isTabStyleChanged = true; }); /*this.chQuickPrint = new Common.UI.CheckBox({ @@ -1127,8 +1129,10 @@ define([], function () { Common.UI.TabStyler.setBackground(this.chTabBack.isChecked() ? 'toolbar' : 'header'); } - if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true)) { + if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true) && this._isTabStyleChanged) { Common.UI.TabStyler.setStyle(this.cmbTabStyle.getValue()); + Common.localStorage.setBool("settings-tab-style-newtheme", true); // use tab style from lc for all themes + this._isTabStyleChanged = false; } if (Common.Utils.InternalSettings.get("de-settings-western-font-size")!==undefined) { diff --git a/apps/pdfeditor/main/app/view/FileMenuPanels.js b/apps/pdfeditor/main/app/view/FileMenuPanels.js index e412aedfa7..fa3d782e7e 100644 --- a/apps/pdfeditor/main/app/view/FileMenuPanels.js +++ b/apps/pdfeditor/main/app/view/FileMenuPanels.js @@ -668,6 +668,8 @@ define([], function () { dataHint: '2', dataHintDirection: 'bottom', dataHintOffset: 'big' + }).on('selected', function(combo, record) { + me._isTabStyleChanged = true; }); this.chTabBack = new Common.UI.CheckBox({ @@ -884,8 +886,10 @@ define([], function () { if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabBackground', true)) { Common.UI.TabStyler.setBackground(this.chTabBack.isChecked() ? 'toolbar' : 'header'); } - if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true)) { + if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true) && this._isTabStyleChanged) { Common.UI.TabStyler.setStyle(this.cmbTabStyle.getValue()); + Common.localStorage.setBool("settings-tab-style-newtheme", true); // use tab style from lc for all themes + this._isTabStyleChanged = false; } Common.localStorage.save(); diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 725774afb8..d564bc0031 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -637,6 +637,8 @@ define([], function () { dataHint: '2', dataHintDirection: 'bottom', dataHintOffset: 'big' + }).on('selected', function(combo, record) { + me._isTabStyleChanged = true; }); this.chTabBack = new Common.UI.CheckBox({ @@ -856,8 +858,10 @@ define([], function () { if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabBackground', true)) { Common.UI.TabStyler.setBackground(this.chTabBack.isChecked() ? 'toolbar' : 'header'); } - if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true)) { + if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true) && this._isTabStyleChanged) { Common.UI.TabStyler.setStyle(this.cmbTabStyle.getValue()); + Common.localStorage.setBool("settings-tab-style-newtheme", true); // use tab style from lc for all themes + this._isTabStyleChanged = false; } Common.localStorage.save(); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 1d672e65f8..cce005438b 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -854,6 +854,8 @@ define([], function () { dataHint: '2', dataHintDirection: 'bottom', dataHintOffset: 'big' + }).on('selected', function(combo, record) { + me._isTabStyleChanged = true; }); var lckey = "app-settings-recent-langs"; @@ -1320,8 +1322,10 @@ define([], function () { if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabBackground', true)) { Common.UI.TabStyler.setBackground(this.chTabBack.isChecked() ? 'toolbar' : 'header'); } - if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true)) { + if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true) && this._isTabStyleChanged) { Common.UI.TabStyler.setStyle(this.cmbTabStyle.getValue()); + Common.localStorage.setBool("settings-tab-style-newtheme", true); // use tab style from lc for all themes + this._isTabStyleChanged = false; } Common.localStorage.save(); if (this.menu) { diff --git a/apps/visioeditor/main/app/view/FileMenuPanels.js b/apps/visioeditor/main/app/view/FileMenuPanels.js index 94d19857dc..88f221b1d3 100644 --- a/apps/visioeditor/main/app/view/FileMenuPanels.js +++ b/apps/visioeditor/main/app/view/FileMenuPanels.js @@ -437,6 +437,8 @@ define([], function () { dataHint: '2', dataHintDirection: 'bottom', dataHintOffset: 'big' + }).on('selected', function(combo, record) { + me._isTabStyleChanged = true; }); this.chTabBack = new Common.UI.CheckBox({ @@ -588,8 +590,10 @@ define([], function () { if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabBackground', true)) { Common.UI.TabStyler.setBackground(this.chTabBack.isChecked() ? 'toolbar' : 'header'); } - if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true)) { + if (!Common.Utils.isIE && Common.UI.FeaturesManager.canChange('tabStyle', true) && this._isTabStyleChanged) { Common.UI.TabStyler.setStyle(this.cmbTabStyle.getValue()); + Common.localStorage.setBool("settings-tab-style-newtheme", true); // use tab style from lc for all themes + this._isTabStyleChanged = false; } Common.localStorage.save();