From c56fadc6dfca78173b16a6563c2a55129da7defe Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 10 Sep 2020 15:00:58 +0300 Subject: [PATCH 1/5] [DE] Shape and TextArt settings: add gradient angle --- .../main/app/template/ShapeSettings.template | 36 +++++++++---- .../app/template/TextArtSettings.template | 36 +++++++++---- .../main/app/view/ShapeSettings.js | 54 ++++++++++++++++--- .../main/app/view/TextArtSettings.js | 49 +++++++++++++++-- apps/documenteditor/main/locale/de.json | 1 + apps/documenteditor/main/locale/en.json | 6 ++- apps/documenteditor/main/locale/es.json | 1 + 7 files changed, 146 insertions(+), 37 deletions(-) diff --git a/apps/documenteditor/main/app/template/ShapeSettings.template b/apps/documenteditor/main/app/template/ShapeSettings.template index 99941da61..1c2ba2c8e 100644 --- a/apps/documenteditor/main/app/template/ShapeSettings.template +++ b/apps/documenteditor/main/app/template/ShapeSettings.template @@ -52,17 +52,31 @@
-
-
- -
-
-
- -
-
-
- + + + + + + + + + +
+
+ +
+
+
+
+ +
+
+
+ + +
+
+
diff --git a/apps/documenteditor/main/app/template/TextArtSettings.template b/apps/documenteditor/main/app/template/TextArtSettings.template index e4e8d61fe..711f3e443 100644 --- a/apps/documenteditor/main/app/template/TextArtSettings.template +++ b/apps/documenteditor/main/app/template/TextArtSettings.template @@ -30,17 +30,31 @@
-
-
- -
-
-
- -
-
-
- + + + + + + + + + +
+
+ +
+
+
+
+ +
+
+
+ + +
+
+
diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index c2e588eab..64baa113c 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -410,6 +410,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); @@ -419,6 +421,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) { @@ -455,11 +459,12 @@ define([ } else { rawData = record; } - this.btnDirection.setIconCls('item-gradient ' + rawData.iconcls); (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); @@ -936,8 +941,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(), @@ -1300,7 +1307,7 @@ define([ this.cmbGradType = new Common.UI.ComboBox({ el: $('#shape-combo-grad-type'), cls: 'input-group-nr', - menuStyle: 'min-width: 90px;', + menuStyle: 'min-width: 100%;', editable: false, data: this._arrGradType }); @@ -1410,7 +1417,7 @@ 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);}); @@ -1422,7 +1429,7 @@ define([ 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'), @@ -1432,7 +1439,21 @@ 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.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ el: $('#shape-combo-border-size'), @@ -1821,6 +1842,7 @@ define([ }); this.lblTransparencyStart.toggleClass('disabled', disable); this.lblTransparencyEnd.toggleClass('disabled', disable); + this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR); } }, @@ -1921,6 +1943,21 @@ 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.imgprops.put_ShapeProperties(props); + this.api.ImgApply(this.imgprops); + } + }, + txtNoBorders : 'No Line', strStroke : 'Stroke', strColor : 'Color', @@ -1959,7 +1996,7 @@ define([ textRadial: 'Radial', textDirection: 'Direction', textStyle: 'Style', - textGradient: 'Gradient', + textGradient: 'Gradient Points', textWrap: 'Wraping Style', txtInline: 'Inline', txtSquare: 'Square', @@ -1982,6 +2019,7 @@ define([ textSelectImage: 'Select Picture', textPosition: 'Position', tipAddGradientPoint: 'Add gradient point', - tipRemoveGradientPoint: 'Remove gradient point' + tipRemoveGradientPoint: 'Remove gradient point', + textAngle: 'Angle' }, DE.Views.ShapeSettings || {})); }); diff --git a/apps/documenteditor/main/app/view/TextArtSettings.js b/apps/documenteditor/main/app/view/TextArtSettings.js index c982851df..a0518c692 100644 --- a/apps/documenteditor/main/app/view/TextArtSettings.js +++ b/apps/documenteditor/main/app/view/TextArtSettings.js @@ -275,6 +275,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); @@ -284,6 +286,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) { @@ -325,6 +329,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_TextArtProperties(); var fill = new Asc.asc_CShapeFill(); fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD); @@ -609,8 +615,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(), @@ -866,7 +874,7 @@ define([ this.cmbGradType = new Common.UI.ComboBox({ el: $('#textart-combo-grad-type'), cls: 'input-group-nr', - menuStyle: 'min-width: 90px;', + menuStyle: 'min-width: 100%;', editable: false, data: this._arrGradType }); @@ -984,7 +992,7 @@ define([ 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); @@ -999,6 +1007,20 @@ define([ this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this)); 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.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ el: $('#textart-combo-border-size'), style: "width: 93px;", @@ -1194,6 +1216,7 @@ define([ _.each(this.lockedControls, function(item) { item.setDisabled(disable); }); + this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR); } }, @@ -1255,6 +1278,21 @@ define([ 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.ImgApply(this.imgprops); + } + }, + txtNoBorders : 'No Line', strStroke : 'Stroke', strColor : 'Color', @@ -1269,13 +1307,14 @@ 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.', textTransform: 'Transform', textTemplate: 'Template', strType: 'Type', textPosition: 'Position', tipAddGradientPoint: 'Add gradient point', - tipRemoveGradientPoint: 'Remove gradient point' + tipRemoveGradientPoint: 'Remove gradient point', + textAngle: 'Angle' }, DE.Views.TextArtSettings || {})); }); diff --git a/apps/documenteditor/main/locale/de.json b/apps/documenteditor/main/locale/de.json index f16fd7b4e..ef81c04e4 100644 --- a/apps/documenteditor/main/locale/de.json +++ b/apps/documenteditor/main/locale/de.json @@ -1963,6 +1963,7 @@ "DE.Views.ShapeSettings.txtTight": "Passend", "DE.Views.ShapeSettings.txtTopAndBottom": "Oben und unten", "DE.Views.ShapeSettings.txtWood": "Holz", + "DE.Views.ShapeSettings.textAngle": "Winkel", "DE.Views.SignatureSettings.notcriticalErrorTitle": "Warnung", "DE.Views.SignatureSettings.strDelete": "Signatur entfernen", "DE.Views.SignatureSettings.strDetails": "Signaturdetails", diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 18ef3838c..a38e2bded 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -2016,7 +2016,7 @@ "DE.Views.ShapeSettings.textFromFile": "From File", "DE.Views.ShapeSettings.textFromStorage": "From Storage", "DE.Views.ShapeSettings.textFromUrl": "From URL", - "DE.Views.ShapeSettings.textGradient": "Gradient", + "DE.Views.ShapeSettings.textGradient": "Gradient Points", "DE.Views.ShapeSettings.textGradientFill": "Gradient Fill", "DE.Views.ShapeSettings.textHint270": "Rotate 90° Counterclockwise", "DE.Views.ShapeSettings.textHint90": "Rotate 90° Clockwise", @@ -2058,6 +2058,7 @@ "DE.Views.ShapeSettings.textPosition": "Position", "DE.Views.ShapeSettings.tipAddGradientPoint": "Add gradient point", "DE.Views.ShapeSettings.tipRemoveGradientPoint": "Remove gradient point", + "DE.Views.ShapeSettings.textAngle": "Angle", "DE.Views.SignatureSettings.notcriticalErrorTitle": "Warning", "DE.Views.SignatureSettings.strDelete": "Remove Signature", "DE.Views.SignatureSettings.strDetails": "Signature Details", @@ -2248,7 +2249,7 @@ "DE.Views.TextArtSettings.textBorderSizeErr": "The entered value is incorrect.
Please enter a value between 0 pt and 1584 pt.", "DE.Views.TextArtSettings.textColor": "Color Fill", "DE.Views.TextArtSettings.textDirection": "Direction", - "DE.Views.TextArtSettings.textGradient": "Gradient", + "DE.Views.TextArtSettings.textGradient": "Gradient Points", "DE.Views.TextArtSettings.textGradientFill": "Gradient Fill", "DE.Views.TextArtSettings.textLinear": "Linear", "DE.Views.TextArtSettings.textNoFill": "No Fill", @@ -2261,6 +2262,7 @@ "DE.Views.TextArtSettings.textPosition": "Position", "DE.Views.TextArtSettings.tipAddGradientPoint": "Add gradient point", "DE.Views.TextArtSettings.tipRemoveGradientPoint": "Remove gradient point", + "DE.Views.TextArtSettings.textAngle": "Angle", "DE.Views.Toolbar.capBtnAddComment": "Add Comment", "DE.Views.Toolbar.capBtnBlankPage": "Blank Page", "DE.Views.Toolbar.capBtnColumns": "Columns", diff --git a/apps/documenteditor/main/locale/es.json b/apps/documenteditor/main/locale/es.json index 180f79178..c9cbb5d14 100644 --- a/apps/documenteditor/main/locale/es.json +++ b/apps/documenteditor/main/locale/es.json @@ -1963,6 +1963,7 @@ "DE.Views.ShapeSettings.txtTight": "Estrecho", "DE.Views.ShapeSettings.txtTopAndBottom": "Superior e inferior", "DE.Views.ShapeSettings.txtWood": "Madera", + "DE.Views.ShapeSettings.textAngle": "Ángulo", "DE.Views.SignatureSettings.notcriticalErrorTitle": "Aviso", "DE.Views.SignatureSettings.strDelete": "Elimine la firma", "DE.Views.SignatureSettings.strDetails": "Detalles de la firma", From 52f635efe03765791970e1327cb9b3d1cd673b52 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 10 Sep 2020 17:16:38 +0300 Subject: [PATCH 2/5] [DE] Fix gradient settings --- apps/documenteditor/main/app/view/ShapeSettings.js | 3 ++- apps/documenteditor/main/app/view/TextArtSettings.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 64baa113c..92148ee3a 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -1419,7 +1419,7 @@ define([ }); 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'), @@ -1454,6 +1454,7 @@ define([ }); 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'), diff --git a/apps/documenteditor/main/app/view/TextArtSettings.js b/apps/documenteditor/main/app/view/TextArtSettings.js index a0518c692..88d505dd4 100644 --- a/apps/documenteditor/main/app/view/TextArtSettings.js +++ b/apps/documenteditor/main/app/view/TextArtSettings.js @@ -985,7 +985,7 @@ define([ }); this.lockedControls.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: $('#textart-gradient-add-step'), @@ -1020,6 +1020,7 @@ define([ }); 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({ el: $('#textart-combo-border-size'), From 07925a04505f91c7f03e75a98cd582acce402e7d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 10 Sep 2020 17:36:45 +0300 Subject: [PATCH 3/5] [PE] Shape, TextArt, Slide settings: add gradient angle --- .../main/app/template/ShapeSettings.template | 36 ++++++++---- .../main/app/template/SlideSettings.template | 36 ++++++++---- .../app/template/TextArtSettings.template | 36 ++++++++---- .../main/app/view/ShapeSettings.js | 55 ++++++++++++++++--- .../main/app/view/SlideSettings.js | 54 +++++++++++++++--- .../main/app/view/TextArtSettings.js | 50 +++++++++++++++-- apps/presentationeditor/main/locale/en.json | 9 ++- 7 files changed, 219 insertions(+), 57 deletions(-) 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", From 726f750c44d627dd6e603cb8680b8bd2b85c0beb Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 10 Sep 2020 20:24:13 +0300 Subject: [PATCH 4/5] [PE] Fix slide lock --- .../main/app/controller/RightMenu.js | 2 +- .../main/app/view/SlideSettings.js | 37 ++++++++++++------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js index 646a27be8..75c2adc67 100644 --- a/apps/presentationeditor/main/app/controller/RightMenu.js +++ b/apps/presentationeditor/main/app/controller/RightMenu.js @@ -177,7 +177,7 @@ define([ if (i == Common.Utils.documentSettingsType.Slide) { if (pnl.locked!==undefined) - this.rightmenu.slideSettings.SetSlideDisabled(this._state.no_slides || pnl.lockedBackground || pnl.locked, + this.rightmenu.slideSettings.setLocked(this._state.no_slides || pnl.lockedBackground || pnl.locked, this._state.no_slides || pnl.lockedEffects || pnl.locked, this._state.no_slides || pnl.lockedTiming || pnl.locked, this._state.no_slides || pnl.lockedHeader || pnl.locked); diff --git a/apps/presentationeditor/main/app/view/SlideSettings.js b/apps/presentationeditor/main/app/view/SlideSettings.js index fa7515969..f50f28230 100644 --- a/apps/presentationeditor/main/app/view/SlideSettings.js +++ b/apps/presentationeditor/main/app/view/SlideSettings.js @@ -77,12 +77,13 @@ define([ this.FillItems = []; - this._stateDisabled = { - background: true, - effects: true, - timing: true, - header: true + this._locked = { + background: false, + effects: false, + timing: false, + header: false }; + this._stateDisabled = {}; this._state = { FillType:undefined, @@ -496,7 +497,7 @@ define([ else this.btnDirection.setIconCls(''); this.numGradientAngle.setValue(this.GradLinearDirectionType); - this.numGradientAngle.setDisabled(this._stateDisabled.background); + this.numGradientAngle.setDisabled(this._locked.background); } else if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_PATH) { this.mnuDirectionPicker.store.reset(this._viewDataRadial); this.mnuDirectionPicker.cmpEl.width(60); @@ -871,7 +872,7 @@ define([ allowDecimal: false, maxValue: 100, minValue: 0, - disabled: this._stateDisabled.background + disabled: this._locked.background }); this.FillItems.push(this.spnGradPosition); this.spnGradPosition.on('change', _.bind(this.onPositionChange, this)); @@ -881,7 +882,7 @@ define([ parentEl: $('#slide-gradient-add-step'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-add-breakpoint', - disabled: this._stateDisabled.background, + disabled: this._locked.background, hint: this.tipAddGradientPoint }); this.btnAddGradientStep.on('click', _.bind(this.onAddGradientStep, this)); @@ -891,7 +892,7 @@ define([ parentEl: $('#slide-gradient-remove-step'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-remove-breakpoint', - disabled: this._stateDisabled.background, + disabled: this._locked.background, hint: this.tipRemoveGradientPoint }); this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this)); @@ -906,7 +907,7 @@ define([ allowDecimal: true, maxValue: 359.9, minValue: 0, - disabled: this._stateDisabled.background + disabled: this._locked.background }); this.FillItems.push(this.numGradientAngle); this.numGradientAngle.on('change', _.bind(this.onGradientAngleChange, this)); @@ -1059,9 +1060,9 @@ define([ this.EffectType = undefined; } - this.cmbEffectType.setDisabled(arr.length<1 || this._stateDisabled.effects); - this.numDuration.setDisabled(arr.length<1 || this._stateDisabled.effects); - this.btnPreview.setDisabled(arr.length<1 || this._stateDisabled.effects); + this.cmbEffectType.setDisabled(arr.length<1 || this._locked.effects); + this.numDuration.setDisabled(arr.length<1 || this._locked.effects); + this.btnPreview.setDisabled(arr.length<1 || this._locked.effects); }, onEffectNameSelect: function(combo, record) { @@ -1195,6 +1196,7 @@ define([ ChangeSettings: function(props) { if (this._initSettings) this.createDelayedElements(); + this.SetSlideDisabled(this._locked.background, this._locked.effects, this._locked.timing, this._locked.header); if (props) { @@ -1525,7 +1527,16 @@ define([ } }, + setLocked: function (background, effects, timing, header) { + this._locked = { + background: background, effects: effects, timing: timing, header: header + }; + }, + SetSlideDisabled: function(background, effects, timing, header) { + this._locked = { + background: background, effects: effects, timing: timing, header: header + }; if (this._initSettings) return; if (background !== this._stateDisabled.background) { From 2e638816d9545b7b8d82034370bc52b9d1333133 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 10 Sep 2020 21:40:54 +0300 Subject: [PATCH 5/5] [SSE] Shape, TextArt settings: add gradient angle --- .../main/app/template/ShapeSettings.template | 36 +++++++++---- .../app/template/TextArtSettings.template | 36 +++++++++---- .../main/app/view/ShapeSettings.js | 54 ++++++++++++++++--- .../main/app/view/TextArtSettings.js | 48 +++++++++++++++-- apps/spreadsheeteditor/main/locale/en.json | 6 ++- 5 files changed, 145 insertions(+), 35 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/template/ShapeSettings.template b/apps/spreadsheeteditor/main/app/template/ShapeSettings.template index 1bca1a8a5..30cbd4f8b 100644 --- a/apps/spreadsheeteditor/main/app/template/ShapeSettings.template +++ b/apps/spreadsheeteditor/main/app/template/ShapeSettings.template @@ -52,17 +52,31 @@
-
-
- -
-
-
- -
-
-
- + + + + + + + + + +
+
+ +
+
+
+
+ +
+
+
+ + +
+
+
diff --git a/apps/spreadsheeteditor/main/app/template/TextArtSettings.template b/apps/spreadsheeteditor/main/app/template/TextArtSettings.template index a89a18a89..d480b1716 100644 --- a/apps/spreadsheeteditor/main/app/template/TextArtSettings.template +++ b/apps/spreadsheeteditor/main/app/template/TextArtSettings.template @@ -70,17 +70,31 @@
-
-
- -
-
-
- -
-
-
- + + + + + + + + + +
+
+ +
+
+
+
+ +
+
+
+ + +
+
+
diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index d382468e5..2de990a01 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -406,6 +406,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); @@ -415,6 +417,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) { @@ -456,6 +460,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.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD); @@ -873,8 +879,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.asc_getColors(), @@ -1348,7 +1356,7 @@ 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);}); @@ -1357,10 +1365,10 @@ define([ 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'), @@ -1370,7 +1378,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(){ Common.NotificationCenter.trigger('edit:complete', me);}); this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ el: $('#shape-combo-border-size'), @@ -1723,6 +1746,7 @@ define([ }); this.lblTransparencyStart.toggleClass('disabled', disable); this.lblTransparencyEnd.toggleClass('disabled', disable); + this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR); } }, @@ -1823,6 +1847,21 @@ 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.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD); + fill.asc_putFill( new Asc.asc_CFillGrad()); + fill.asc_getFill().asc_putGradType(this.GradFillType); + fill.asc_getFill().asc_putLinearAngle(field.getNumberValue() * 60000); + fill.asc_getFill().asc_putLinearScale(true); + props.asc_putFill(fill); + this.imgprops.asc_putShapeProperties(props); + this.api.asc_setGraphicObjectProps(this.imgprops); + } + }, + txtNoBorders : 'No Line', strStroke : 'Stroke', strColor : 'Color', @@ -1861,7 +1900,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', @@ -1876,6 +1915,7 @@ define([ textSelectImage: 'Select Picture', textPosition: 'Position', tipAddGradientPoint: 'Add gradient point', - tipRemoveGradientPoint: 'Remove gradient point' + tipRemoveGradientPoint: 'Remove gradient point', + textAngle: 'Angle' }, SSE.Views.ShapeSettings || {})); }); diff --git a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js index 4413045a5..fba8ae1e9 100644 --- a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js @@ -396,6 +396,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); @@ -405,6 +407,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) { @@ -446,6 +450,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_TextArtProperties(); var fill = new Asc.asc_CShapeFill(); fill.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD); @@ -807,8 +813,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.asc_getColors(), @@ -1295,7 +1303,7 @@ define([ 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); @@ -1310,6 +1318,21 @@ define([ this.btnRemoveGradientStep.on('click', _.bind(this.onRemoveGradientStep, this)); 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(){ Common.NotificationCenter.trigger('edit:complete', me);}); + this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ el: $('#textart-combo-border-size'), style: "width: 93px;", @@ -1629,6 +1652,7 @@ define([ _.each(this.lockedControls, function(item) { item.setDisabled(disable); }); + this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR); } }, @@ -1689,6 +1713,21 @@ define([ 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.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD); + fill.asc_putFill( new Asc.asc_CFillGrad()); + fill.asc_getFill().asc_putGradType(this.GradFillType); + fill.asc_getFill().asc_putLinearAngle(field.getNumberValue() * 60000); + fill.asc_getFill().asc_putLinearScale(true); + props.asc_putFill(fill); + this.shapeprops.put_TextArtProperties(props); + this.api.asc_setGraphicObjectProps(this.imgprops); + } + }, + txtNoBorders : 'No Line', strStroke : 'Stroke', strColor : 'Color', @@ -1725,13 +1764,14 @@ 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.', textTransform: 'Transform', textTemplate: 'Template', strType: 'Type', textPosition: 'Position', tipAddGradientPoint: 'Add gradient point', - tipRemoveGradientPoint: 'Remove gradient point' + tipRemoveGradientPoint: 'Remove gradient point', + textAngle: 'Angle' }, SSE.Views.TextArtSettings || {})); }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 4b746e016..40e254a5c 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -2283,7 +2283,7 @@ "SSE.Views.ShapeSettings.textFromFile": "From File", "SSE.Views.ShapeSettings.textFromStorage": "From Storage", "SSE.Views.ShapeSettings.textFromUrl": "From URL", - "SSE.Views.ShapeSettings.textGradient": "Gradient", + "SSE.Views.ShapeSettings.textGradient": "Gradient Points", "SSE.Views.ShapeSettings.textGradientFill": "Gradient Fill", "SSE.Views.ShapeSettings.textHint270": "Rotate 90° Counterclockwise", "SSE.Views.ShapeSettings.textHint90": "Rotate 90° Clockwise", @@ -2318,6 +2318,7 @@ "SSE.Views.ShapeSettings.textPosition": "Position", "SSE.Views.ShapeSettings.tipAddGradientPoint": "Add gradient point", "SSE.Views.ShapeSettings.tipRemoveGradientPoint": "Remove gradient point", + "SSE.Views.ShapeSettings.textAngle": "Angle", "SSE.Views.ShapeSettingsAdvanced.strColumns": "Columns", "SSE.Views.ShapeSettingsAdvanced.strMargins": "Text Padding", "SSE.Views.ShapeSettingsAdvanced.textAbsolute": "Don't move or size with cells", @@ -2626,7 +2627,7 @@ "SSE.Views.TextArtSettings.textEmptyPattern": "No Pattern", "SSE.Views.TextArtSettings.textFromFile": "From File", "SSE.Views.TextArtSettings.textFromUrl": "From URL", - "SSE.Views.TextArtSettings.textGradient": "Gradient", + "SSE.Views.TextArtSettings.textGradient": "Gradient Points", "SSE.Views.TextArtSettings.textGradientFill": "Gradient Fill", "SSE.Views.TextArtSettings.textImageTexture": "Picture or Texture", "SSE.Views.TextArtSettings.textLinear": "Linear", @@ -2655,6 +2656,7 @@ "SSE.Views.TextArtSettings.textPosition": "Position", "SSE.Views.TextArtSettings.tipAddGradientPoint": "Add gradient point", "SSE.Views.TextArtSettings.tipRemoveGradientPoint": "Remove gradient point", + "SSE.Views.TextArtSettings.textAngle": "Angle", "SSE.Views.Toolbar.capBtnAddComment": "Add Comment", "SSE.Views.Toolbar.capBtnComment": "Comment", "SSE.Views.Toolbar.capBtnInsHeader": "Header/Footer",