[DE PE SSE] View tab: fix zoom, add Show frozen panes shadow

This commit is contained in:
JuliaSvinareva 2021-12-14 13:10:32 +03:00
parent 25c5b79697
commit e91a68a160
5 changed files with 40 additions and 3 deletions

View file

@ -113,7 +113,10 @@ define([
{ displayValue: "125%", value: 125 },
{ displayValue: "150%", value: 150 },
{ displayValue: "175%", value: 175 },
{ displayValue: "200%", value: 200 }
{ displayValue: "200%", value: 200 },
{ displayValue: "300%", value: 300 },
{ displayValue: "400%", value: 400 },
{ displayValue: "500%", value: 500 }
],
dataHint : '1',
dataHintDirection: 'top',

View file

@ -98,7 +98,10 @@ define([
{ displayValue: "125%", value: 125 },
{ displayValue: "150%", value: 150 },
{ displayValue: "175%", value: 175 },
{ displayValue: "200%", value: 200 }
{ displayValue: "200%", value: 200 },
{ displayValue: "300%", value: 300 },
{ displayValue: "400%", value: 400 },
{ displayValue: "500%", value: 500 }
],
dataHint : '1',
dataHintDirection: 'top',

View file

@ -85,6 +85,7 @@ define([
this.addListeners({
'ViewTab': {
'viewtab:freeze': this.onFreeze,
'viewtab:freezeshadow': this.onFreezeShadow,
'viewtab:formula': this.onViewSettings,
'viewtab:headings': this.onViewSettings,
'viewtab:gridlines': this.onViewSettings,
@ -105,6 +106,11 @@ define([
'view:compact': _.bind(function (toolbar, state) {
this.view.chToolbar.setValue(!state, true);
}, this)
},
'Common.Views.Header': {
'toolbar:freezeshadow': _.bind(function (isChecked) {
this.view.btnFreezePanes.menu.items[4].setChecked(isChecked, true);
}, this)
}
});
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
@ -137,6 +143,13 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.view);
},
onFreezeShadow: function (checked) {
this.api.asc_setFrozenPaneBorderType(checked ? Asc.c_oAscFrozenPaneBorderType.shadow : Asc.c_oAscFrozenPaneBorderType.line);
Common.localStorage.setBool('sse-freeze-shadow', checked);
this.view.fireEvent('freeze:shadow', [checked]);
Common.NotificationCenter.trigger('edit:complete', this.view);
},
onZoom: function(zoom) {
if (this.api) {
this.api.asc_setZoom(zoom/100);

View file

@ -118,6 +118,11 @@ define([
if ( me.header.btnSave )
me.header.btnSave.setDisabled(state);
}
},
'ViewTab': {
'freeze:shadow': function (checked) {
me.header.mnuitemFreezePanesShadow.setChecked(checked, true);
}
}
});
@ -511,6 +516,7 @@ define([
case 'freezepanesshadow':
me.api.asc_setFrozenPaneBorderType(item.isChecked() ? Asc.c_oAscFrozenPaneBorderType.shadow : Asc.c_oAscFrozenPaneBorderType.line);
Common.localStorage.setBool('sse-freeze-shadow', item.isChecked());
me.header.fireEvent('toolbar:freezeshadow', [item.isChecked()]);
break;
case 'advanced': me.header.fireEvent('file:settings', me.header); break;
}

View file

@ -58,7 +58,11 @@ define([
}
me.btnFreezePanes.menu.on('item:click', function (menu, item, e) {
me.fireEvent('viewtab:freeze', [item.value]);
if (item.value === 'shadow') {
me.fireEvent('viewtab:freezeshadow', [item.checked]);
} else {
me.fireEvent('viewtab:freeze', [item.value]);
}
});
this.chFormula.on('change', function (field, value) {
me.fireEvent('viewtab:formula', [0, value]);
@ -286,6 +290,13 @@ define([
{
caption: me.textFreezeCol,
value: Asc.c_oAscFrozenPaneAddType.firstCol
},
{ caption: '--' },
{
caption: me.textShowFrozenPanesShadow,
value: 'shadow',
checkable: true,
checked: Common.localStorage.getBool('sse-freeze-shadow', true)
}
]
}));
@ -403,6 +414,7 @@ define([
textCombineSheetAndStatusBars: 'Combine sheet and status bars',
textAlwaysShowToolbar: 'Always show toolbar',
textInterfaceTheme: 'Interface theme',
textShowFrozenPanesShadow: 'Show frozen panes shadow'
}
}()), SSE.Views.ViewTab || {}));
});