From 76f2021618c0a6a99a1b855233e353e84ca99467 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 13 Mar 2012 11:23:32 -0700 Subject: Add a smoothing amount parameter, and hide options based on checkboxes --- .../brush-properties.reel/brush-properties.html | 24 ++++++++++++++--- .../brush-properties.reel/brush-properties.js | 30 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) (limited to 'js/components/tools-properties') diff --git a/js/components/tools-properties/brush-properties.reel/brush-properties.html b/js/components/tools-properties/brush-properties.reel/brush-properties.html index 608111bd..cbe4c242 100755 --- a/js/components/tools-properties/brush-properties.reel/brush-properties.html +++ b/js/components/tools-properties/brush-properties.reel/brush-properties.html @@ -33,7 +33,8 @@ "maxValue": 100, "value": 100, "decimalPlace": 10, - "acceptableUnits" : ["px", "pt"] + "acceptableUnits" : ["%"], + "units" : "%" } }, @@ -46,6 +47,20 @@ "maxValue": 90, "value": 0, "decimalPlace": 10, + "acceptableUnits" : ["deg."], + "units" : "deg." + } + }, + + "smoothingAmountHT": { + "module": "js/components/hottextunit.reel", + "name": "HotTextUnit", + "properties": { + "element": {"#": "smoothingAmount"}, + "minValue": 0, + "maxValue": 100, + "value": 0, + "decimalPlace": 10, "acceptableUnits" : ["px", "pt"] } }, @@ -58,8 +73,10 @@ "_strokeSize": {"@": "strokeSizeHT"}, "_strokeHardness": {"@": "strokeHardnessHT"}, "_doSmoothing": {"#": "doSmoothing"}, + "_smoothingAmount": {"@": "smoothingAmountHT"}, "_useCalligraphic":{"#": "useCalligraphic"}, - "_strokeAngle": {"@": "strokeAngleHT"} + "_strokeAngle": {"@": "strokeAngleHT"}, + "_angleLabel": {"#": "angleLabel"} } } } @@ -75,8 +92,9 @@
+
- +
diff --git a/js/components/tools-properties/brush-properties.reel/brush-properties.js b/js/components/tools-properties/brush-properties.reel/brush-properties.js index e6faa0f0..fdcd50f8 100755 --- a/js/components/tools-properties/brush-properties.reel/brush-properties.js +++ b/js/components/tools-properties/brush-properties.reel/brush-properties.js @@ -9,6 +9,33 @@ var Component = require("montage/ui/component").Component; var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; exports.BrushProperties = Montage.create(ToolProperties, { + _subPrepare: { + value: function() { + this.handleChange(null); + this._useCalligraphic.addEventListener("change", this, false); + this._doSmoothing.addEventListener("change", this, false); + } + }, + handleChange: { + value: function(event) { + if(this._useCalligraphic.checked) { + this._strokeAngle.element.style["display"] = ""; + this._strokeAngle.visible = true; + this._angleLabel.style["display"] = ""; + } else { + this._strokeAngle.element.style["display"] = "none"; + this._strokeAngle.visible = false; + this._angleLabel.style["display"] = "none"; + } + if(this._doSmoothing.checked) { + this._smoothingAmount.element.style["display"] = ""; + this._smoothingAmount.visible = true; + } else { + this._smoothingAmount.element.style["display"] = "none"; + this._smoothingAmount.visible = false; + } + } + }, strokeSize: { get: function() { return this._strokeSize; } }, @@ -18,6 +45,9 @@ exports.BrushProperties = Montage.create(ToolProperties, { doSmoothing:{ get: function() {return this._doSmoothing.checked; } }, + smoothingAmount:{ + get: function() {return this._smoothingAmount;} + }, useCalligraphic: { get: function() {return this._useCalligraphic.checked;} }, -- cgit v1.2.3 From 23baa44e0bc7bfb24e42702c1ef58bf62da083d8 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Wed, 14 Mar 2012 15:37:09 -0700 Subject: PI for pen and brush strokes --- .../tools-properties/brush-properties.reel/brush-properties.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'js/components/tools-properties') diff --git a/js/components/tools-properties/brush-properties.reel/brush-properties.html b/js/components/tools-properties/brush-properties.reel/brush-properties.html index cbe4c242..98442164 100755 --- a/js/components/tools-properties/brush-properties.reel/brush-properties.html +++ b/js/components/tools-properties/brush-properties.reel/brush-properties.html @@ -53,15 +53,14 @@ }, "smoothingAmountHT": { - "module": "js/components/hottextunit.reel", - "name": "HotTextUnit", + "module": "js/components/hottext.reel", + "name": "HotText", "properties": { "element": {"#": "smoothingAmount"}, "minValue": 0, "maxValue": 100, "value": 0, - "decimalPlace": 10, - "acceptableUnits" : ["px", "pt"] + "decimalPlace": 10 } }, -- cgit v1.2.3 From 313354a8ff9ed21b826ab5f280bcf1095a64a7f4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 19 Mar 2012 18:11:50 -0700 Subject: fully removing our old button component from Ninja Signed-off-by: Valerio Virgillito --- .../tools-properties/text-properties.reel/text-properties.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/components/tools-properties') diff --git a/js/components/tools-properties/text-properties.reel/text-properties.html b/js/components/tools-properties/text-properties.reel/text-properties.html index 13a88ba7..2d50a79e 100755 --- a/js/components/tools-properties/text-properties.reel/text-properties.html +++ b/js/components/tools-properties/text-properties.reel/text-properties.html @@ -69,7 +69,7 @@ }, "fontSettings": { - "module": "js/components/button.reel", + "module": "montage/ui/button.reel", "name": "Button", "properties": { "element": {"#": "fontSettings"} -- cgit v1.2.3 From 5308a9404ef131ba6457eec840b017a3e436b9da Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 22 Mar 2012 15:17:18 -0700 Subject: Fixed the lock button for the shape properties bar Signed-off-by: Valerio Virgillito --- .../rect-properties.reel/rect-properties.css | 19 +++++++++---------- .../rect-properties.reel/rect-properties.html | 15 +++++++++++++-- .../rect-properties.reel/rect-properties.js | 20 ++++++++------------ 3 files changed, 30 insertions(+), 24 deletions(-) (limited to 'js/components/tools-properties') diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.css b/js/components/tools-properties/rect-properties.reel/rect-properties.css index 74509555..cbd9dde8 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.css +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.css @@ -4,16 +4,15 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -.rectProperties .button { - border:none; - cursor:default; - text-align:center; - -webkit-user-select:none; - opacity:0.8; - display:table-cell; - vertical-align:middle; - background-color:#333333; - color:white; +#lockButton { + float:left; + border: none; + background-color: transparent; + top: 2px; + opacity: 0.7; + width: 17px; + height: 18px; + margin-right: 10px; } .rectProperties .subToolButton { diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.html b/js/components/tools-properties/rect-properties.reel/rect-properties.html index 214ff1d5..fd51b9ad 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.html +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.html @@ -50,12 +50,22 @@ } }, + "lockButton": { + "prototype": "montage/ui/toggle-button.reel", + "properties": { + "element": {"#": "lockButton"}, + "pressedClass": "lockUp", + "preventFocus": true, + "identifier": "ratio" + } + }, + "owner": { "module": "js/components/tools-properties/rect-properties.reel", "name": "RectProperties", "properties": { "element": {"#": "rectProperties"}, - "lockButton": {"#": "lockButton"}, + "lockButton": {"@": "lockButton"}, "TLRadiusControl": {"@": "hottext1"}, "TRRadiusControl": {"@": "hottext2"}, "BLRadiusControl": {"@": "hottext3"}, @@ -69,7 +79,8 @@
- + +
diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.js b/js/components/tools-properties/rect-properties.reel/rect-properties.js index b2de6ff7..cc99cca6 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.js +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.js @@ -19,7 +19,8 @@ exports.RectProperties = Montage.create(ToolProperties, { _subPrepare: { value: function() { - this.lockButton.addEventListener("click", this, false); + this.lockButton.identifier = "lockButton"; + this.lockButton.addEventListener("action", this, false); this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); this._setCap([this.TLRadiusControl,this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); @@ -27,21 +28,16 @@ exports.RectProperties = Montage.create(ToolProperties, { } }, - handleClick: { + handleLockButtonAction: { value: function(event) { - this._unlocked = !this._unlocked; + this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = this.lockButton.pressed; - this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = this._unlocked; - - if(this._unlocked) { - this.lockButton.classList.remove("LockToolUp"); - this.lockButton.classList.add("UnLockToolUp"); - this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); - } else { - this.lockButton.classList.remove("UnLockToolUp"); - this.lockButton.classList.add("LockToolUp"); + if(this.lockButton.pressed) { this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); + } else { + this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); } + } }, -- cgit v1.2.3 From 007c5c91c91a2b6359ee4b14501190a81ba2a05e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 22 Mar 2012 16:00:28 -0700 Subject: fixing the shape properties border bindings. Signed-off-by: Valerio Virgillito --- .../tools-properties/rect-properties.reel/rect-properties.html | 1 + js/components/tools-properties/rect-properties.reel/rect-properties.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'js/components/tools-properties') diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.html b/js/components/tools-properties/rect-properties.reel/rect-properties.html index fd51b9ad..ceb761b9 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.html +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.html @@ -54,6 +54,7 @@ "prototype": "montage/ui/toggle-button.reel", "properties": { "element": {"#": "lockButton"}, + "pressed": true, "pressedClass": "lockUp", "preventFocus": true, "identifier": "ratio" diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.js b/js/components/tools-properties/rect-properties.reel/rect-properties.js index cc99cca6..f023f4bb 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.js +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.js @@ -30,7 +30,7 @@ exports.RectProperties = Montage.create(ToolProperties, { handleLockButtonAction: { value: function(event) { - this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = this.lockButton.pressed; + this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = !this.lockButton.pressed; if(this.lockButton.pressed) { this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); -- cgit v1.2.3