diff --git a/apps/presentationeditor/main/app/template/ShapeSettings.template b/apps/presentationeditor/main/app/template/ShapeSettings.template index 1bca1a8a5..30cbd4f8b 100644 --- a/apps/presentationeditor/main/app/template/ShapeSettings.template +++ b/apps/presentationeditor/main/app/template/ShapeSettings.template @@ -52,17 +52,31 @@
-
-
- -
-
-
- -
-
-
- + + + + + + + + + +
+
+ +
+
+
+
+ +
+
+
+ + +
+
+
diff --git a/apps/presentationeditor/main/app/template/SlideSettings.template b/apps/presentationeditor/main/app/template/SlideSettings.template index 6fcfca484..267fe7abf 100644 --- a/apps/presentationeditor/main/app/template/SlideSettings.template +++ b/apps/presentationeditor/main/app/template/SlideSettings.template @@ -52,17 +52,31 @@
-
-
- -
-
-
- -
-
-
- + + + + + + + + + +
+
+ +
+
+
+
+ +
+
+
+ + +
+
+
diff --git a/apps/presentationeditor/main/app/template/TextArtSettings.template b/apps/presentationeditor/main/app/template/TextArtSettings.template index a89a18a89..d480b1716 100644 --- a/apps/presentationeditor/main/app/template/TextArtSettings.template +++ b/apps/presentationeditor/main/app/template/TextArtSettings.template @@ -70,17 +70,31 @@
-
-
- -
-
-
- -
-
-
- + + + + + + + + + +
+
+ +
+
+
+
+ +
+
+
+ + +
+
+
diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index ad3f325d6..131096bb5 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -394,6 +394,8 @@ define([ this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); else this.btnDirection.setIconCls(''); + this.numGradientAngle.setValue(this.GradLinearDirectionType); + this.numGradientAngle.setDisabled(this._locked); } else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) { this.mnuDirectionPicker.store.reset(this._viewDataRadial); this.mnuDirectionPicker.cmpEl.width(60); @@ -403,6 +405,8 @@ define([ this.btnDirection.setIconCls('item-gradient ' + this._viewDataRadial[this.GradRadialDirectionIdx].iconcls); else this.btnDirection.setIconCls(''); + this.numGradientAngle.setValue(0); + this.numGradientAngle.setDisabled(true); } if (this.api && !this._noApply) { @@ -443,6 +447,8 @@ define([ (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0; if (this.api) { if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) { + this.numGradientAngle.setValue(rawData.type); + var props = new Asc.asc_CShapeProperty(); var fill = new Asc.asc_CShapeFill(); fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD); @@ -849,8 +855,10 @@ define([ this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); else this.btnDirection.setIconCls(''); + this.numGradientAngle.setValue(value); } - } + } else + this.numGradientAngle.setValue(0); var me = this; var colors = fill.get_colors(), @@ -1322,19 +1330,19 @@ define([ minValue: 0, disabled: this._locked }); - this.lockedControls.push(this.spnGradPosition); + this.fillControls.push(this.spnGradPosition); 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({ parentEl: $('#shape-gradient-add-step'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-add-breakpoint', disabled: this._locked, - hint: this.tipAddGradientPoint, + hint: this.tipAddGradientPoint }); this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this)); - this.lockedControls.push(this.btnAddGradientStep); + this.fillControls.push(this.btnAddGradientStep); this.btnRemoveGradientStep = new Common.UI.Button({ parentEl: $('#shape-gradient-remove-step'), @@ -1344,7 +1352,22 @@ define([ hint: this.tipRemoveGradientPoint }); 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({ el: $('#shape-combo-border-size'), @@ -1693,6 +1716,7 @@ define([ }); this.lblTransparencyStart.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); }, + 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', strStroke : 'Stroke', strColor : 'Color', @@ -1830,7 +1868,7 @@ define([ textRadial: 'Radial', textDirection: 'Direction', textStyle: 'Style', - textGradient: 'Gradient', + textGradient: 'Gradient Points', textBorderSizeErr: 'The entered value is incorrect.
Please enter a value between 0 pt and 1584 pt.', strType: 'Type', textRotation: 'Rotation', @@ -1845,6 +1883,7 @@ define([ textSelectImage: 'Select Picture', textPosition: 'Position', tipAddGradientPoint: 'Add gradient point', - tipRemoveGradientPoint: 'Remove gradient point' + tipRemoveGradientPoint: 'Remove gradient point', + textAngle: 'Angle' }, PE.Views.ShapeSettings || {})); }); diff --git a/apps/presentationeditor/main/app/view/SlideSettings.js b/apps/presentationeditor/main/app/view/SlideSettings.js index f55e5e1d5..fa7515969 100644 --- a/apps/presentationeditor/main/app/view/SlideSettings.js +++ b/apps/presentationeditor/main/app/view/SlideSettings.js @@ -495,6 +495,8 @@ define([ this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); else this.btnDirection.setIconCls(''); + this.numGradientAngle.setValue(this.GradLinearDirectionType); + this.numGradientAngle.setDisabled(this._stateDisabled.background); } else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) { this.mnuDirectionPicker.store.reset(this._viewDataRadial); this.mnuDirectionPicker.cmpEl.width(60); @@ -504,6 +506,8 @@ define([ this.btnDirection.setIconCls('item-gradient ' + this._viewDataRadial[this.GradRadialDirectionIdx].iconcls); else this.btnDirection.setIconCls(''); + this.numGradientAngle.setValue(0); + this.numGradientAngle.setDisabled(true); } if (this.api && !this._noApply) { @@ -544,6 +548,8 @@ define([ (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0; if (this.api) { if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) { + this.numGradientAngle.setValue(rawData.type); + var props = new Asc.CAscSlideProps(); var fill = new Asc.asc_CShapeFill(); fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD); @@ -865,18 +871,18 @@ define([ allowDecimal: false, maxValue: 100, minValue: 0, - disabled: this._locked + disabled: this._stateDisabled.background }); this.FillItems.push(this.spnGradPosition); 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({ parentEl: $('#slide-gradient-add-step'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-add-breakpoint', - disabled: this._locked, - hint: this.tipAddGradientPoint, + disabled: this._stateDisabled.background, + hint: this.tipAddGradientPoint }); this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this)); this.FillItems.push(this.btnAddGradientStep); @@ -885,12 +891,26 @@ define([ parentEl: $('#slide-gradient-remove-step'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-remove-breakpoint', - disabled: this._locked, + disabled: this._stateDisabled.background, hint: this.tipRemoveGradientPoint }); this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this)); 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() { @@ -1281,8 +1301,10 @@ define([ this.btnDirection.setIconCls('item-gradient ' + record.get('iconcls')); else this.btnDirection.setIconCls(''); + this.numGradientAngle.setValue(value); } - } + } else + this.numGradientAngle.setValue(0); var me = this; var colors = fill.get_colors(), @@ -1511,6 +1533,7 @@ define([ for (var i=0; iPlease enter a value between 0 pt and 1584 pt.', textTransform: 'Transform', textTemplate: 'Template', strType: 'Type', textPosition: 'Position', tipAddGradientPoint: 'Add gradient point', - tipRemoveGradientPoint: 'Remove gradient point' + tipRemoveGradientPoint: 'Remove gradient point', + textAngle: 'Angle' }, PE.Views.TextArtSettings || {})); }); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 467bad8b5..8dc00e830 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1451,7 +1451,7 @@ "PE.Views.ShapeSettings.textFromFile": "From File", "PE.Views.ShapeSettings.textFromStorage": "From Storage", "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.textHint270": "Rotate 90° Counterclockwise", "PE.Views.ShapeSettings.textHint90": "Rotate 90° Clockwise", @@ -1485,6 +1485,7 @@ "PE.Views.ShapeSettings.textPosition": "Position", "PE.Views.ShapeSettings.tipAddGradientPoint": "Add gradient point", "PE.Views.ShapeSettings.tipRemoveGradientPoint": "Remove gradient point", + "PE.Views.ShapeSettings.textAngle": "Angle", "PE.Views.ShapeSettingsAdvanced.strColumns": "Columns", "PE.Views.ShapeSettingsAdvanced.strMargins": "Text Padding", "PE.Views.ShapeSettingsAdvanced.textAlt": "Alternative Text", @@ -1566,7 +1567,7 @@ "PE.Views.SlideSettings.textFromFile": "From File", "PE.Views.SlideSettings.textFromStorage": "From Storage", "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.textHorizontalIn": "Horizontal In", "PE.Views.SlideSettings.textHorizontalOut": "Horizontal Out", @@ -1616,6 +1617,7 @@ "PE.Views.SlideSettings.textPosition": "Position", "PE.Views.SlideSettings.tipAddGradientPoint": "Add 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.textTitle": "Show Settings", "PE.Views.SlideSizeSettings.strLandscape": "Landscape", @@ -1733,7 +1735,7 @@ "PE.Views.TextArtSettings.textEmptyPattern": "No Pattern", "PE.Views.TextArtSettings.textFromFile": "From File", "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.textImageTexture": "Picture or Texture", "PE.Views.TextArtSettings.textLinear": "Linear", @@ -1762,6 +1764,7 @@ "PE.Views.TextArtSettings.textPosition": "Position", "PE.Views.TextArtSettings.tipAddGradientPoint": "Add gradient point", "PE.Views.TextArtSettings.tipRemoveGradientPoint": "Remove gradient point", + "PE.Views.TextArtSettings.textAngle": "Angle", "PE.Views.Toolbar.capAddSlide": "Add Slide", "PE.Views.Toolbar.capBtnAddComment": "Add Comment", "PE.Views.Toolbar.capBtnComment": "Comment",