[SSE] Distribute objects

This commit is contained in:
Julia Radzhabova 2019-02-14 17:50:36 +03:00
parent 7d0066312e
commit 492671642c
5 changed files with 34 additions and 4 deletions

View file

@ -1951,6 +1951,10 @@ define([
toolbar.btnImgGroup.menu.items[1].setDisabled(!canungroup);
toolbar.lockToolbar(SSE.enumLock.cantGroup, !cangroup, { array: [toolbar.btnImgAlign]});
var objcount = this.api.asc_getSelectedDrawingObjectsCount();
toolbar.btnImgAlign.menu.items[7].setDisabled(objcount<3);
toolbar.btnImgAlign.menu.items[8].setDisabled(objcount<3);
if (editOptionsDisabled) return;
/* read font params */
@ -3270,10 +3274,19 @@ define([
},
onImgAlignSelect: function(menu, item) {
if (this.api)
this.api.asc_setSelectedDrawingObjectAlign(item.value);
if (this.api) {
if (item.value>-1 && item.value < 6) {
this.api.asc_setSelectedDrawingObjectAlign(item.value);
Common.component.Analytics.trackEvent('ToolBar', 'Objects Align');
} else if (item.value == 6) {
this.api.asc_DistributeSelectedDrawingObjectHor();
Common.component.Analytics.trackEvent('ToolBar', 'Distribute');
} else if (item.value == 7){
this.api.asc_DistributeSelectedDrawingObjectVer();
Common.component.Analytics.trackEvent('ToolBar', 'Distribute');
}
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Objects Align');
},
onPrintAreaClick: function(menu, item) {

View file

@ -958,7 +958,9 @@ define([
textShapeAlignCenter : 'Align Center',
textShapeAlignTop : 'Align Top',
textShapeAlignBottom : 'Align Bottom',
textShapeAlignMiddle : 'Align Middle'
textShapeAlignMiddle : 'Align Middle',
txtDistribHor: 'Distribute Horizontally',
txtDistribVert: 'Distribute Vertically'
}, SSE.Views.DocumentHolder || {}));
});

View file

@ -2202,6 +2202,17 @@ define([
caption : _holder_view.textShapeAlignBottom,
iconCls : 'mnu-img-align-bottom',
value : 2
},
{caption: '--'},
{
caption: _holder_view.txtDistribHor,
iconCls: 'mnu-distrib-hor',
value: 6
},
{
caption: _holder_view.txtDistribHor,
iconCls: 'mnu-distrib-vert',
value: 7
}]
}));

View file

@ -366,6 +366,8 @@
"SSE.Controllers.DocumentHolder.txtUnderbar": "Bar under text",
"SSE.Controllers.DocumentHolder.txtUndoExpansion": "Undo table autoexpansion",
"SSE.Controllers.DocumentHolder.txtWidth": "Width",
"SSE.Controllers.DocumentHolder.txtDistribHor": "Distribute Horizontally",
"SSE.Controllers.DocumentHolder.txtDistribVert": "Distribute Vertically",
"SSE.Controllers.LeftMenu.newDocumentTitle": "Unnamed spreadsheet",
"SSE.Controllers.LeftMenu.textByColumns": "By columns",
"SSE.Controllers.LeftMenu.textByRows": "By rows",

View file

@ -213,6 +213,8 @@
.menu-btn-icon(mnu-img-align-bottom, 45, @menu-icon-size);
.menu-btn-icon(mnu-img-align-middle, 44, @menu-icon-size);
.menu-btn-icon(mnu-img-align-top, 43, @menu-icon-size);
.menu-btn-icon(mnu-distrib-hor, 46, @menu-icon-size);
.menu-btn-icon(mnu-distrib-vert, 47, @menu-icon-size);
.username-tip {
background-color: #ee3525;