From 1ea7e95bee11fd4f9c2952f31eee7b6eac8c7cd0 Mon Sep 17 00:00:00 2001 From: Alexei Koshelev Date: Sat, 23 Dec 2023 19:59:48 +0300 Subject: [PATCH] [SSE DE PE] Fix bug in shape shape menu --- .../main/app/view/ShapeSettings.js | 17 ++++++++++++++++- .../main/resources/less/rightmenu.less | 2 +- .../main/app/view/ShapeSettings.js | 17 ++++++++++++++++- .../main/resources/less/rightmenu.less | 2 +- .../main/app/view/ShapeSettings.js | 17 ++++++++++++++++- .../main/resources/less/rightmenu.less | 2 +- 6 files changed, 51 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 55b0881ea0..5850d32e70 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -96,6 +96,7 @@ define([ BGColor: 'ffffff', GradColor: '000000', ShadowColor: 'transparent', + ShadowPreset: null, GradFillType: Asc.c_oAscFillGradType.GRAD_LINEAR, WrappingStyle: Asc.c_oAscWrapStyle2.Inline, CanBeFlow: true, @@ -1328,8 +1329,10 @@ define([ } if(shadowPresetRecord) { + this._state.ShadowPreset = shadowPresetRecord; this.viewShadowShapePresets.selectRecord(shadowPresetRecord); } else { + this._state.ShadowPreset = null; this.viewShadowShapePresets.deselectAll(); } @@ -1921,6 +1924,18 @@ define([ ); this.btnShadowShape.menu.on('item:click', _.bind(this.onSelectShadowMenu, this)); this.mnuShadowShapeColor.menu.on('item:click', _.bind(this.onSelectShadowColorMenu, this)); + this.btnShadowShape.menu.on('show:before', () => { + if(this._state.ShadowPreset) { + this.viewShadowShapePresets.selectRecord(this._state.ShadowPreset); + } else { + this.viewShadowShapePresets.deselectAll(); + } + }); + this.mnuShadowShapeColor.menu.on('show:before', () => { + if(this._state.ShadowColor) { + this.mnuShadowShapeColorPicker.select(this._state.ShadowColor,true); + } + }); this.viewShadowShapePresets = new Common.UI.DataView({ el: $('#shape-button-shadow-shape-menu'), @@ -1943,7 +1958,7 @@ define([ ]), itemTemplate: _.template( '
' + - '
' + + '
' + '
') }); this.viewShadowShapePresets.on('item:click', _.bind(this.onSelectShadowPreset, this)); diff --git a/apps/documenteditor/main/resources/less/rightmenu.less b/apps/documenteditor/main/resources/less/rightmenu.less index f664e2574c..330cdccab7 100644 --- a/apps/documenteditor/main/resources/less/rightmenu.less +++ b/apps/documenteditor/main/resources/less/rightmenu.less @@ -271,7 +271,7 @@ height: 32px; background: white; border-radius: 1px; - border: 1px rgba(0, 0, 0, 0.80) solid; + border: 1px var(--icon-normal) solid; } } diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index 705156853a..46cd4aefce 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -93,6 +93,7 @@ define([ BGColor: 'ffffff', GradColor: '000000', ShadowColor: 'transparent', + ShadowPreset: null, GradFillType: Asc.c_oAscFillGradType.GRAD_LINEAR, DisabledFillPanels: false, DisabledControls: false, @@ -1256,8 +1257,10 @@ define([ } if(shadowPresetRecord) { + this._state.ShadowPreset = shadowPresetRecord; this.viewShadowShapePresets.selectRecord(shadowPresetRecord); } else { + this._state.ShadowPreset = null; this.viewShadowShapePresets.deselectAll(); } @@ -1784,6 +1787,18 @@ define([ ); this.btnShadowShape.menu.on('item:click', _.bind(this.onSelectShadowMenu, this)); this.mnuShadowShapeColor.menu.on('item:click', _.bind(this.onSelectShadowColorMenu, this)); + this.btnShadowShape.menu.on('show:before', () => { + if(this._state.ShadowPreset) { + this.viewShadowShapePresets.selectRecord(this._state.ShadowPreset); + } else { + this.viewShadowShapePresets.deselectAll(); + } + }); + this.mnuShadowShapeColor.menu.on('show:before', () => { + if(this._state.ShadowColor) { + this.mnuShadowShapeColorPicker.select(this._state.ShadowColor,true); + } + }); this.viewShadowShapePresets = new Common.UI.DataView({ el: $('#shape-button-shadow-shape-menu'), @@ -1806,7 +1821,7 @@ define([ ]), itemTemplate: _.template( '
' + - '
' + + '
' + '
') }); this.viewShadowShapePresets.on('item:click', _.bind(this.onSelectShadowPreset, this)); diff --git a/apps/presentationeditor/main/resources/less/rightmenu.less b/apps/presentationeditor/main/resources/less/rightmenu.less index efd559dafa..9f8b93bf89 100644 --- a/apps/presentationeditor/main/resources/less/rightmenu.less +++ b/apps/presentationeditor/main/resources/less/rightmenu.less @@ -186,7 +186,7 @@ height: 32px; background: white; border-radius: 1px; - border: 1px rgba(0, 0, 0, 0.80) solid; + border: 1px var(--icon-normal) solid; } } diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index 3bcf336787..68193bf7d1 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -94,6 +94,7 @@ define([ BGColor: 'ffffff', GradColor: '000000', ShadowColor: 'transparent', + ShadowPreset: null, GradFillType: Asc.c_oAscFillGradType.GRAD_LINEAR, DisabledFillPanels: false, DisabledControls: false, @@ -1251,8 +1252,10 @@ define([ } if(shadowPresetRecord) { + this._state.ShadowPreset = shadowPresetRecord; this.viewShadowShapePresets.selectRecord(shadowPresetRecord); } else { + this._state.ShadowPreset = null; this.viewShadowShapePresets.deselectAll(); } @@ -1799,6 +1802,18 @@ define([ ); this.btnShadowShape.menu.on('item:click', _.bind(this.onSelectShadowMenu, this)); this.mnuShadowShapeColor.menu.on('item:click', _.bind(this.onSelectShadowColorMenu, this)); + this.btnShadowShape.menu.on('show:before', () => { + if(this._state.ShadowPreset) { + this.viewShadowShapePresets.selectRecord(this._state.ShadowPreset); + } else { + this.viewShadowShapePresets.deselectAll(); + } + }); + this.mnuShadowShapeColor.menu.on('show:before', () => { + if(this._state.ShadowColor) { + this.mnuShadowShapeColorPicker.select(this._state.ShadowColor,true); + } + }); this.viewShadowShapePresets = new Common.UI.DataView({ el: $('#shape-button-shadow-shape-menu'), @@ -1821,7 +1836,7 @@ define([ ]), itemTemplate: _.template( '
' + - '
' + + '
' + '
') }); this.viewShadowShapePresets.on('item:click', _.bind(this.onSelectShadowPreset, this)); diff --git a/apps/spreadsheeteditor/main/resources/less/rightmenu.less b/apps/spreadsheeteditor/main/resources/less/rightmenu.less index 52ac254ba3..8b1157093d 100644 --- a/apps/spreadsheeteditor/main/resources/less/rightmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/rightmenu.less @@ -184,7 +184,7 @@ height: 32px; background: white; border-radius: 1px; - border: 1px rgba(0, 0, 0, 0.80) solid; + border: 1px var(--icon-normal) solid; } }