[PE] Shape, TextArt, Slide settings: add gradient angle

This commit is contained in:
Julia Radzhabova 2020-09-10 17:36:45 +03:00
parent 52f635efe0
commit 07925a0450
7 changed files with 219 additions and 57 deletions

View file

@ -52,17 +52,31 @@
</div> </div>
</div> </div>
<div id="shape-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;"> <div id="shape-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;">
<div style="height:80px;"> <table cols="3" style="margin-bottom: 10px;">
<div style="display: inline-block;"> <tr valign="top">
<label class="input-label" style=""><%= scope.textStyle %></label> <td colspan="2">
<div id="shape-combo-grad-type" style="width: 90px;"></div> <div>
</div> <label class="input-label" style=""><%= scope.textStyle %></label>
<div style="display: inline-block;float: right;"> <div id="shape-combo-grad-type" style="width: 100%;"></div>
<label class="input-label" style=""><%= scope.textDirection %></label> </div>
<div id="shape-button-direction" style=""></div> </td>
</div> <td rowspan="2" style="width: 100%;">
</div> <div style="float: right;">
<label class="header" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label> <label class="input-label"><%= scope.textDirection %></label>
<div id="shape-button-direction"></div>
</div>
</td>
</tr>
<tr valign="bottom">
<td>
<label class="input-label" style="margin-right: 5px;margin-bottom: 3px;"><%= scope.textAngle %></label>
</td>
<td>
<div id="shape-spin-gradient-angle" style="display: inline-block; width: 60px;"></div>
</td>
</tr>
</table>
<label class="input-label" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>
<div style="display: inline-block; margin-top: 3px;"> <div style="display: inline-block; margin-top: 3px;">
<div id="shape-slider-gradient" style="display: inline-block; vertical-align: middle;"></div> <div id="shape-slider-gradient" style="display: inline-block; vertical-align: middle;"></div>
</div> </div>

View file

@ -52,17 +52,31 @@
</div> </div>
</div> </div>
<div id="slide-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;"> <div id="slide-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;">
<div style="height:80px;"> <table cols="3" style="margin-bottom: 10px;">
<div style="display: inline-block;"> <tr valign="top">
<label class="input-label" style=""><%= scope.textStyle %></label> <td colspan="2">
<div id="slide-combo-grad-type" style="width: 90px;"></div> <div>
</div> <label class="input-label" style=""><%= scope.textStyle %></label>
<div style="display: inline-block;float: right;"> <div id="slide-combo-grad-type" style="width: 100%;"></div>
<label class="input-label" style=""><%= scope.textDirection %></label> </div>
<div id="slide-button-direction" style=""></div> </td>
</div> <td rowspan="2" style="width: 100%;">
</div> <div style="float: right;">
<label class="header" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label> <label class="input-label"><%= scope.textDirection %></label>
<div id="slide-button-direction"></div>
</div>
</td>
</tr>
<tr valign="bottom">
<td>
<label class="input-label" style="margin-right: 5px;margin-bottom: 3px;"><%= scope.textAngle %></label>
</td>
<td>
<div id="slide-spin-gradient-angle" style="display: inline-block; width: 60px;"></div>
</td>
</tr>
</table>
<label class="input-label" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>
<div style="display: inline-block; margin-top: 3px;"> <div style="display: inline-block; margin-top: 3px;">
<div id="slide-slider-gradient" style="display: inline-block; vertical-align: middle;"></div> <div id="slide-slider-gradient" style="display: inline-block; vertical-align: middle;"></div>
</div> </div>

View file

@ -70,17 +70,31 @@
</div> </div>
</div> </div>
<div id="textart-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;"> <div id="textart-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;">
<div style="height:80px;"> <table cols="3" style="margin-bottom: 10px;">
<div style="display: inline-block;"> <tr valign="top">
<label class="input-label" style=""><%= scope.textStyle %></label> <td colspan="2">
<div id="textart-combo-grad-type" style="width: 90px;"></div> <div>
</div> <label class="input-label" style=""><%= scope.textStyle %></label>
<div style="display: inline-block;float: right;"> <div id="textart-combo-grad-type" style="width: 100%;"></div>
<label class="input-label" style=""><%= scope.textDirection %></label> </div>
<div id="textart-button-direction" style=""></div> </td>
</div> <td rowspan="2" style="width: 100%;">
</div> <div style="float: right;">
<label class="header" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label> <label class="input-label"><%= scope.textDirection %></label>
<div id="textart-button-direction"></div>
</div>
</td>
</tr>
<tr valign="bottom">
<td>
<label class="input-label" style="margin-right: 5px;margin-bottom: 3px;"><%= scope.textAngle %></label>
</td>
<td>
<div id="textart-spin-gradient-angle" style="display: inline-block; width: 60px;"></div>
</td>
</tr>
</table>
<label class="input-label" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>
<div style="display: inline-block; margin-top: 3px;"> <div style="display: inline-block; margin-top: 3px;">
<div id="textart-slider-gradient" style="display: inline-block; vertical-align: middle;"></div> <div id="textart-slider-gradient" style="display: inline-block; vertical-align: middle;"></div>
</div> </div>

View file

@ -394,6 +394,8 @@ define([
this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls'));
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(this.GradLinearDirectionType);
this.numGradientAngle.setDisabled(this._locked);
} else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) { } else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) {
this.mnuDirectionPicker.store.reset(this._viewDataRadial); this.mnuDirectionPicker.store.reset(this._viewDataRadial);
this.mnuDirectionPicker.cmpEl.width(60); this.mnuDirectionPicker.cmpEl.width(60);
@ -403,6 +405,8 @@ define([
this.btnDirection.setIconCls('item-gradient ' + this._viewDataRadial[this.GradRadialDirectionIdx].iconcls); this.btnDirection.setIconCls('item-gradient ' + this._viewDataRadial[this.GradRadialDirectionIdx].iconcls);
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(0);
this.numGradientAngle.setDisabled(true);
} }
if (this.api && !this._noApply) { if (this.api && !this._noApply) {
@ -443,6 +447,8 @@ define([
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0; (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0;
if (this.api) { if (this.api) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) { if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
this.numGradientAngle.setValue(rawData.type);
var props = new Asc.asc_CShapeProperty(); var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill(); var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD); fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
@ -849,8 +855,10 @@ define([
this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls'));
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(value);
} }
} } else
this.numGradientAngle.setValue(0);
var me = this; var me = this;
var colors = fill.get_colors(), var colors = fill.get_colors(),
@ -1322,19 +1330,19 @@ define([
minValue: 0, minValue: 0,
disabled: this._locked disabled: this._locked
}); });
this.lockedControls.push(this.spnGradPosition); this.fillControls.push(this.spnGradPosition);
this.spnGradPosition.on('change', _.bind(this.onPositionChange, this)); this.spnGradPosition.on('change', _.bind(this.onPositionChange, this));
this.spnGradPosition.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); this.spnGradPosition.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
this.btnAddGradientStep = new Common.UI.Button({ this.btnAddGradientStep = new Common.UI.Button({
parentEl: $('#shape-gradient-add-step'), parentEl: $('#shape-gradient-add-step'),
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-add-breakpoint', iconCls: 'toolbar__icon btn-add-breakpoint',
disabled: this._locked, disabled: this._locked,
hint: this.tipAddGradientPoint, hint: this.tipAddGradientPoint
}); });
this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this)); this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this));
this.lockedControls.push(this.btnAddGradientStep); this.fillControls.push(this.btnAddGradientStep);
this.btnRemoveGradientStep = new Common.UI.Button({ this.btnRemoveGradientStep = new Common.UI.Button({
parentEl: $('#shape-gradient-remove-step'), parentEl: $('#shape-gradient-remove-step'),
@ -1344,7 +1352,22 @@ define([
hint: this.tipRemoveGradientPoint hint: this.tipRemoveGradientPoint
}); });
this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this)); this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this));
this.lockedControls.push(this.btnRemoveGradientStep); this.fillControls.push(this.btnRemoveGradientStep);
this.numGradientAngle = new Common.UI.MetricSpinner({
el: $('#shape-spin-gradient-angle'),
step: 1,
width: 60,
defaultUnit : "°",
value: '0 °',
allowDecimal: true,
maxValue: 359.9,
minValue: 0,
disabled: this._locked
});
this.fillControls.push(this.numGradientAngle);
this.numGradientAngle.on('change', _.bind(this.onGradientAngleChange, this));
this.numGradientAngle.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
el: $('#shape-combo-border-size'), el: $('#shape-combo-border-size'),
@ -1693,6 +1716,7 @@ define([
}); });
this.lblTransparencyStart.toggleClass('disabled', disable); this.lblTransparencyStart.toggleClass('disabled', disable);
this.lblTransparencyEnd.toggleClass('disabled', disable); this.lblTransparencyEnd.toggleClass('disabled', disable);
this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR);
} }
}, },
@ -1792,6 +1816,20 @@ define([
this.sldrGradient.trigger('changecomplete', this.sldrGradient); this.sldrGradient.trigger('changecomplete', this.sldrGradient);
}, },
onGradientAngleChange: function(field, newValue, oldValue, eOpts) {
if (this.api) {
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_linear_angle(field.getNumberValue() * 60000);
fill.get_fill().put_linear_scale(true);
props.put_fill(fill);
this.api.ShapeApply(props);
}
},
txtNoBorders : 'No Line', txtNoBorders : 'No Line',
strStroke : 'Stroke', strStroke : 'Stroke',
strColor : 'Color', strColor : 'Color',
@ -1830,7 +1868,7 @@ define([
textRadial: 'Radial', textRadial: 'Radial',
textDirection: 'Direction', textDirection: 'Direction',
textStyle: 'Style', textStyle: 'Style',
textGradient: 'Gradient', textGradient: 'Gradient Points',
textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.', textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.',
strType: 'Type', strType: 'Type',
textRotation: 'Rotation', textRotation: 'Rotation',
@ -1845,6 +1883,7 @@ define([
textSelectImage: 'Select Picture', textSelectImage: 'Select Picture',
textPosition: 'Position', textPosition: 'Position',
tipAddGradientPoint: 'Add gradient point', tipAddGradientPoint: 'Add gradient point',
tipRemoveGradientPoint: 'Remove gradient point' tipRemoveGradientPoint: 'Remove gradient point',
textAngle: 'Angle'
}, PE.Views.ShapeSettings || {})); }, PE.Views.ShapeSettings || {}));
}); });

View file

@ -495,6 +495,8 @@ define([
this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls'));
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(this.GradLinearDirectionType);
this.numGradientAngle.setDisabled(this._stateDisabled.background);
} else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) { } else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) {
this.mnuDirectionPicker.store.reset(this._viewDataRadial); this.mnuDirectionPicker.store.reset(this._viewDataRadial);
this.mnuDirectionPicker.cmpEl.width(60); this.mnuDirectionPicker.cmpEl.width(60);
@ -504,6 +506,8 @@ define([
this.btnDirection.setIconCls('item-gradient ' + this._viewDataRadial[this.GradRadialDirectionIdx].iconcls); this.btnDirection.setIconCls('item-gradient ' + this._viewDataRadial[this.GradRadialDirectionIdx].iconcls);
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(0);
this.numGradientAngle.setDisabled(true);
} }
if (this.api && !this._noApply) { if (this.api && !this._noApply) {
@ -544,6 +548,8 @@ define([
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0; (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0;
if (this.api) { if (this.api) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) { if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
this.numGradientAngle.setValue(rawData.type);
var props = new Asc.CAscSlideProps(); var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill(); var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD); fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
@ -865,18 +871,18 @@ define([
allowDecimal: false, allowDecimal: false,
maxValue: 100, maxValue: 100,
minValue: 0, minValue: 0,
disabled: this._locked disabled: this._stateDisabled.background
}); });
this.FillItems.push(this.spnGradPosition); this.FillItems.push(this.spnGradPosition);
this.spnGradPosition.on('change', _.bind(this.onPositionChange, this)); this.spnGradPosition.on('change', _.bind(this.onPositionChange, this));
this.spnGradPosition.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); this.spnGradPosition.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
this.btnAddGradientStep = new Common.UI.Button({ this.btnAddGradientStep = new Common.UI.Button({
parentEl: $('#slide-gradient-add-step'), parentEl: $('#slide-gradient-add-step'),
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-add-breakpoint', iconCls: 'toolbar__icon btn-add-breakpoint',
disabled: this._locked, disabled: this._stateDisabled.background,
hint: this.tipAddGradientPoint, hint: this.tipAddGradientPoint
}); });
this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this)); this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this));
this.FillItems.push(this.btnAddGradientStep); this.FillItems.push(this.btnAddGradientStep);
@ -885,12 +891,26 @@ define([
parentEl: $('#slide-gradient-remove-step'), parentEl: $('#slide-gradient-remove-step'),
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-remove-breakpoint', iconCls: 'toolbar__icon btn-remove-breakpoint',
disabled: this._locked, disabled: this._stateDisabled.background,
hint: this.tipRemoveGradientPoint hint: this.tipRemoveGradientPoint
}); });
this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this)); this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this));
this.FillItems.push(this.btnRemoveGradientStep); this.FillItems.push(this.btnRemoveGradientStep);
this.numGradientAngle = new Common.UI.MetricSpinner({
el: $('#slide-spin-gradient-angle'),
step: 1,
width: 60,
defaultUnit : "°",
value: '0 °',
allowDecimal: true,
maxValue: 359.9,
minValue: 0,
disabled: this._stateDisabled.background
});
this.FillItems.push(this.numGradientAngle);
this.numGradientAngle.on('change', _.bind(this.onGradientAngleChange, this));
this.numGradientAngle.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
}, },
createDelayedElements: function() { createDelayedElements: function() {
@ -1281,8 +1301,10 @@ define([
this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls'));
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(value);
} }
} } else
this.numGradientAngle.setValue(0);
var me = this; var me = this;
var colors = fill.get_colors(), var colors = fill.get_colors(),
@ -1511,6 +1533,7 @@ define([
for (var i=0; i<this.FillItems.length; i++) { for (var i=0; i<this.FillItems.length; i++) {
this.FillItems[i].setDisabled(background); this.FillItems[i].setDisabled(background);
} }
this.numGradientAngle.setDisabled(background || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR);
this._stateDisabled.background = background; this._stateDisabled.background = background;
} }
if (effects !== this._stateDisabled.effects) { if (effects !== this._stateDisabled.effects) {
@ -1592,6 +1615,20 @@ define([
this.sldrGradient.trigger('changecomplete', this.sldrGradient); this.sldrGradient.trigger('changecomplete', this.sldrGradient);
}, },
onGradientAngleChange: function(field, newValue, oldValue, eOpts) {
if (this.api) {
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_linear_angle(field.getNumberValue() * 60000);
fill.get_fill().put_linear_scale(true);
props.put_background(fill);
this.api.SetSlideProps(props);
}
},
strColor : 'Color', strColor : 'Color',
strFill : 'Background', strFill : 'Background',
textColor : 'Color Fill', textColor : 'Color Fill',
@ -1660,7 +1697,7 @@ define([
textRadial: 'Radial', textRadial: 'Radial',
textDirection: 'Direction', textDirection: 'Direction',
textStyle: 'Style', textStyle: 'Style',
textGradient: 'Gradient', textGradient: 'Gradient Points',
textSec: 's', textSec: 's',
strSlideNum: 'Show Slide Number', strSlideNum: 'Show Slide Number',
strDateTime: 'Show Date and Time', strDateTime: 'Show Date and Time',
@ -1668,6 +1705,7 @@ define([
textSelectImage: 'Select Picture', textSelectImage: 'Select Picture',
textPosition: 'Position', textPosition: 'Position',
tipAddGradientPoint: 'Add gradient point', tipAddGradientPoint: 'Add gradient point',
tipRemoveGradientPoint: 'Remove gradient point' tipRemoveGradientPoint: 'Remove gradient point',
textAngle: 'Angle'
}, PE.Views.SlideSettings || {})); }, PE.Views.SlideSettings || {}));
}); });

View file

@ -395,6 +395,8 @@ define([
this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls'));
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(this.GradLinearDirectionType);
this.numGradientAngle.setDisabled(this._locked);
} else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) { } else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) {
this.mnuDirectionPicker.store.reset(this._viewDataRadial); this.mnuDirectionPicker.store.reset(this._viewDataRadial);
this.mnuDirectionPicker.cmpEl.width(60); this.mnuDirectionPicker.cmpEl.width(60);
@ -404,6 +406,8 @@ define([
this.btnDirection.setIconCls('item-gradient ' + this._viewDataRadial[this.GradRadialDirectionIdx].iconcls); this.btnDirection.setIconCls('item-gradient ' + this._viewDataRadial[this.GradRadialDirectionIdx].iconcls);
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(0);
this.numGradientAngle.setDisabled(true);
} }
if (this.api && !this._noApply) { if (this.api && !this._noApply) {
@ -445,6 +449,8 @@ define([
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0; (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0;
if (this.api) { if (this.api) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) { if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
this.numGradientAngle.setValue(rawData.type);
var props = new Asc.asc_TextArtProperties(); var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill(); var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD); fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
@ -803,8 +809,10 @@ define([
this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls'));
else else
this.btnDirection.setIconCls(''); this.btnDirection.setIconCls('');
this.numGradientAngle.setValue(value);
} }
} } else
this.numGradientAngle.setValue(0);
var me = this; var me = this;
var colors = fill.get_colors(), var colors = fill.get_colors(),
@ -1284,14 +1292,14 @@ define([
}); });
this.lockedControls.push(this.spnGradPosition); this.lockedControls.push(this.spnGradPosition);
this.spnGradPosition.on('change', _.bind(this.onPositionChange, this)); this.spnGradPosition.on('change', _.bind(this.onPositionChange, this));
this.spnGradPosition.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); this.spnGradPosition.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
this.btnAddGradientStep = new Common.UI.Button({ this.btnAddGradientStep = new Common.UI.Button({
parentEl: $('#textart-gradient-add-step'), parentEl: $('#textart-gradient-add-step'),
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-add-breakpoint', iconCls: 'toolbar__icon btn-add-breakpoint',
disabled: this._locked, disabled: this._locked,
hint: this.tipAddGradientPoint, hint: this.tipAddGradientPoint
}); });
this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this)); this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this));
this.lockedControls.push(this.btnAddGradientStep); this.lockedControls.push(this.btnAddGradientStep);
@ -1306,6 +1314,21 @@ define([
this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this)); this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this));
this.lockedControls.push(this.btnRemoveGradientStep); this.lockedControls.push(this.btnRemoveGradientStep);
this.numGradientAngle = new Common.UI.MetricSpinner({
el: $('#textart-spin-gradient-angle'),
step: 1,
width: 60,
defaultUnit : "°",
value: '0 °',
allowDecimal: true,
maxValue: 359.9,
minValue: 0,
disabled: this._locked
});
this.lockedControls.push(this.numGradientAngle);
this.numGradientAngle.on('change', _.bind(this.onGradientAngleChange, this));
this.numGradientAngle.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
el: $('#textart-combo-border-size'), el: $('#textart-combo-border-size'),
style: "width: 93px;", style: "width: 93px;",
@ -1625,6 +1648,7 @@ define([
_.each(this.lockedControls, function(item) { _.each(this.lockedControls, function(item) {
item.setDisabled(disable); item.setDisabled(disable);
}); });
this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR);
} }
}, },
@ -1686,6 +1710,21 @@ define([
this.sldrGradient.trigger('changecomplete', this.sldrGradient); this.sldrGradient.trigger('changecomplete', this.sldrGradient);
}, },
onGradientAngleChange: function(field, newValue, oldValue, eOpts) {
if (this.api) {
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_linear_angle(field.getNumberValue() * 60000);
fill.get_fill().put_linear_scale(true);
props.asc_putFill(fill);
this.shapeprops.put_TextArtProperties(props);
this.api.ShapeApply(this.shapeprops);
}
},
txtNoBorders : 'No Line', txtNoBorders : 'No Line',
strStroke : 'Stroke', strStroke : 'Stroke',
strColor : 'Color', strColor : 'Color',
@ -1722,13 +1761,14 @@ define([
textRadial: 'Radial', textRadial: 'Radial',
textDirection: 'Direction', textDirection: 'Direction',
textStyle: 'Style', textStyle: 'Style',
textGradient: 'Gradient', textGradient: 'Gradient Points',
textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.', textBorderSizeErr: 'The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.',
textTransform: 'Transform', textTransform: 'Transform',
textTemplate: 'Template', textTemplate: 'Template',
strType: 'Type', strType: 'Type',
textPosition: 'Position', textPosition: 'Position',
tipAddGradientPoint: 'Add gradient point', tipAddGradientPoint: 'Add gradient point',
tipRemoveGradientPoint: 'Remove gradient point' tipRemoveGradientPoint: 'Remove gradient point',
textAngle: 'Angle'
}, PE.Views.TextArtSettings || {})); }, PE.Views.TextArtSettings || {}));
}); });

View file

@ -1451,7 +1451,7 @@
"PE.Views.ShapeSettings.textFromFile": "From File", "PE.Views.ShapeSettings.textFromFile": "From File",
"PE.Views.ShapeSettings.textFromStorage": "From Storage", "PE.Views.ShapeSettings.textFromStorage": "From Storage",
"PE.Views.ShapeSettings.textFromUrl": "From URL", "PE.Views.ShapeSettings.textFromUrl": "From URL",
"PE.Views.ShapeSettings.textGradient": "Gradient", "PE.Views.ShapeSettings.textGradient": "Gradient Points",
"PE.Views.ShapeSettings.textGradientFill": "Gradient Fill", "PE.Views.ShapeSettings.textGradientFill": "Gradient Fill",
"PE.Views.ShapeSettings.textHint270": "Rotate 90° Counterclockwise", "PE.Views.ShapeSettings.textHint270": "Rotate 90° Counterclockwise",
"PE.Views.ShapeSettings.textHint90": "Rotate 90° Clockwise", "PE.Views.ShapeSettings.textHint90": "Rotate 90° Clockwise",
@ -1485,6 +1485,7 @@
"PE.Views.ShapeSettings.textPosition": "Position", "PE.Views.ShapeSettings.textPosition": "Position",
"PE.Views.ShapeSettings.tipAddGradientPoint": "Add gradient point", "PE.Views.ShapeSettings.tipAddGradientPoint": "Add gradient point",
"PE.Views.ShapeSettings.tipRemoveGradientPoint": "Remove gradient point", "PE.Views.ShapeSettings.tipRemoveGradientPoint": "Remove gradient point",
"PE.Views.ShapeSettings.textAngle": "Angle",
"PE.Views.ShapeSettingsAdvanced.strColumns": "Columns", "PE.Views.ShapeSettingsAdvanced.strColumns": "Columns",
"PE.Views.ShapeSettingsAdvanced.strMargins": "Text Padding", "PE.Views.ShapeSettingsAdvanced.strMargins": "Text Padding",
"PE.Views.ShapeSettingsAdvanced.textAlt": "Alternative Text", "PE.Views.ShapeSettingsAdvanced.textAlt": "Alternative Text",
@ -1566,7 +1567,7 @@
"PE.Views.SlideSettings.textFromFile": "From File", "PE.Views.SlideSettings.textFromFile": "From File",
"PE.Views.SlideSettings.textFromStorage": "From Storage", "PE.Views.SlideSettings.textFromStorage": "From Storage",
"PE.Views.SlideSettings.textFromUrl": "From URL", "PE.Views.SlideSettings.textFromUrl": "From URL",
"PE.Views.SlideSettings.textGradient": "Gradient", "PE.Views.SlideSettings.textGradient": "Gradient Points",
"PE.Views.SlideSettings.textGradientFill": "Gradient Fill", "PE.Views.SlideSettings.textGradientFill": "Gradient Fill",
"PE.Views.SlideSettings.textHorizontalIn": "Horizontal In", "PE.Views.SlideSettings.textHorizontalIn": "Horizontal In",
"PE.Views.SlideSettings.textHorizontalOut": "Horizontal Out", "PE.Views.SlideSettings.textHorizontalOut": "Horizontal Out",
@ -1616,6 +1617,7 @@
"PE.Views.SlideSettings.textPosition": "Position", "PE.Views.SlideSettings.textPosition": "Position",
"PE.Views.SlideSettings.tipAddGradientPoint": "Add gradient point", "PE.Views.SlideSettings.tipAddGradientPoint": "Add gradient point",
"PE.Views.SlideSettings.tipRemoveGradientPoint": "Remove gradient point", "PE.Views.SlideSettings.tipRemoveGradientPoint": "Remove gradient point",
"PE.Views.SlideSettings.textAngle": "Angle",
"PE.Views.SlideshowSettings.textLoop": "Loop continuously until 'Esc' is pressed", "PE.Views.SlideshowSettings.textLoop": "Loop continuously until 'Esc' is pressed",
"PE.Views.SlideshowSettings.textTitle": "Show Settings", "PE.Views.SlideshowSettings.textTitle": "Show Settings",
"PE.Views.SlideSizeSettings.strLandscape": "Landscape", "PE.Views.SlideSizeSettings.strLandscape": "Landscape",
@ -1733,7 +1735,7 @@
"PE.Views.TextArtSettings.textEmptyPattern": "No Pattern", "PE.Views.TextArtSettings.textEmptyPattern": "No Pattern",
"PE.Views.TextArtSettings.textFromFile": "From File", "PE.Views.TextArtSettings.textFromFile": "From File",
"PE.Views.TextArtSettings.textFromUrl": "From URL", "PE.Views.TextArtSettings.textFromUrl": "From URL",
"PE.Views.TextArtSettings.textGradient": "Gradient", "PE.Views.TextArtSettings.textGradient": "Gradient Points",
"PE.Views.TextArtSettings.textGradientFill": "Gradient Fill", "PE.Views.TextArtSettings.textGradientFill": "Gradient Fill",
"PE.Views.TextArtSettings.textImageTexture": "Picture or Texture", "PE.Views.TextArtSettings.textImageTexture": "Picture or Texture",
"PE.Views.TextArtSettings.textLinear": "Linear", "PE.Views.TextArtSettings.textLinear": "Linear",
@ -1762,6 +1764,7 @@
"PE.Views.TextArtSettings.textPosition": "Position", "PE.Views.TextArtSettings.textPosition": "Position",
"PE.Views.TextArtSettings.tipAddGradientPoint": "Add gradient point", "PE.Views.TextArtSettings.tipAddGradientPoint": "Add gradient point",
"PE.Views.TextArtSettings.tipRemoveGradientPoint": "Remove gradient point", "PE.Views.TextArtSettings.tipRemoveGradientPoint": "Remove gradient point",
"PE.Views.TextArtSettings.textAngle": "Angle",
"PE.Views.Toolbar.capAddSlide": "Add Slide", "PE.Views.Toolbar.capAddSlide": "Add Slide",
"PE.Views.Toolbar.capBtnAddComment": "Add Comment", "PE.Views.Toolbar.capBtnAddComment": "Add Comment",
"PE.Views.Toolbar.capBtnComment": "Comment", "PE.Views.Toolbar.capBtnComment": "Comment",