From 894a5b8f8945a5a76e5125d0e8bb464506f5368b Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 23 Feb 2015 18:17:24 -0800 Subject: [PATCH] [Fixed Position] Add text color property Add a property to the Fixed Position toolbar to set text color, WTD-881. --- platform/features/layout/bundle.json | 6 ++++++ .../features/layout/res/templates/elements/telemetry.html | 2 +- platform/features/layout/res/templates/elements/text.html | 2 +- platform/features/layout/src/FixedController.js | 1 + platform/features/layout/src/elements/ElementFactory.js | 3 ++- platform/features/layout/src/elements/TextProxy.js | 7 +++++++ platform/forms/res/templates/controls/color.html | 2 +- 7 files changed, 19 insertions(+), 4 deletions(-) diff --git a/platform/features/layout/bundle.json b/platform/features/layout/bundle.json index a85ce3d980..ba27f5e1c9 100644 --- a/platform/features/layout/bundle.json +++ b/platform/features/layout/bundle.json @@ -92,6 +92,12 @@ "property": "stroke", "glyph": "-", "control": "color" + }, + { + "property": "color", + "glyph": "\u1D1B", + "mandatory": true, + "control": "color" } ] }, diff --git a/platform/features/layout/res/templates/elements/telemetry.html b/platform/features/layout/res/templates/elements/telemetry.html index 051c33e159..8f8f44461f 100644 --- a/platform/features/layout/res/templates/elements/telemetry.html +++ b/platform/features/layout/res/templates/elements/telemetry.html @@ -1,4 +1,4 @@ -
{{ngModel.name}} diff --git a/platform/features/layout/res/templates/elements/text.html b/platform/features/layout/res/templates/elements/text.html index 043df913cf..627468d3e2 100644 --- a/platform/features/layout/res/templates/elements/text.html +++ b/platform/features/layout/res/templates/elements/text.html @@ -1,4 +1,4 @@ -
{{ngModel.element.text}}
\ No newline at end of file diff --git a/platform/features/layout/src/FixedController.js b/platform/features/layout/src/FixedController.js index dc298a1d89..963afc8713 100644 --- a/platform/features/layout/src/FixedController.js +++ b/platform/features/layout/src/FixedController.js @@ -194,6 +194,7 @@ define( y: Math.floor(position.y / gridSize[1]), id: id, stroke: "transparent", + color: "#717171", width: DEFAULT_DIMENSIONS[0], height: DEFAULT_DIMENSIONS[1] }); diff --git a/platform/features/layout/src/elements/ElementFactory.js b/platform/features/layout/src/elements/ElementFactory.js index e61b0136d5..3ae8cad80a 100644 --- a/platform/features/layout/src/elements/ElementFactory.js +++ b/platform/features/layout/src/elements/ElementFactory.js @@ -23,7 +23,8 @@ define( }, "fixed.text": { fill: "transparent", - stroke: "transparent" + stroke: "transparent", + color: "#717171" } }, DIALOGS = { diff --git a/platform/features/layout/src/elements/TextProxy.js b/platform/features/layout/src/elements/TextProxy.js index 53ba553672..a1da84399c 100644 --- a/platform/features/layout/src/elements/TextProxy.js +++ b/platform/features/layout/src/elements/TextProxy.js @@ -20,6 +20,13 @@ define( function TextProxy(element, index, elements) { var proxy = new BoxProxy(element, index, elements); + /** + * Get and/or set the text color of this element. + * @param {string} [color] the new text color (if setting) + * @returns {string} the text color + */ + proxy.color = new AccessorMutator(element, 'color'); + return proxy; } diff --git a/platform/forms/res/templates/controls/color.html b/platform/forms/res/templates/controls/color.html index f880838a0c..31f9f3bec2 100644 --- a/platform/forms/res/templates/controls/color.html +++ b/platform/forms/res/templates/controls/color.html @@ -15,7 +15,7 @@