From f4df8204a57e1bc6021b651ebb2259f9931cf26f Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 22 May 2012 13:21:32 -0700 Subject: allow changes in the pen subtool in options to be seen by the pen tool code (can now select the pen plus, pen minus subtools) AND add keyboard shortcut for brush tool --- js/data/tools-data.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/data') diff --git a/js/data/tools-data.js b/js/data/tools-data.js index 32eaf24d..179e8e81 100755 --- a/js/data/tools-data.js +++ b/js/data/tools-data.js @@ -100,7 +100,7 @@ exports.ToolsData = Montage.create(Montage, { "properties": "penProperties", "spriteSheet": true, "action": "PenTool", - "toolTip": "Pen Tool", + "toolTip": "Pen Tool (P)", "cursor": "auto", "lastInGroup": false, "container": false, @@ -159,7 +159,7 @@ exports.ToolsData = Montage.create(Montage, { "properties": "brushProperties", "spriteSheet": true, "action": "BrushTool", - "toolTip": "Brush Tool", + "toolTip": "Brush Tool (B)", "cursor": "url('images/tools/brush_down.png') 9 17, default", "lastInGroup": false, "container": false, -- cgit v1.2.3 From d8840eda0d3b3e31fb5a72306fe66608f4f99c2b Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 29 May 2012 23:52:59 -0700 Subject: fixing the menu bindings and some cleanup of the stage Signed-off-by: Valerio Virgillito --- js/data/menu-data.js | 147 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 55 deletions(-) (limited to 'js/data') diff --git a/js/data/menu-data.js b/js/data/menu-data.js index aeb95ccc..6c597542 100755 --- a/js/data/menu-data.js +++ b/js/data/menu-data.js @@ -4,9 +4,51 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -var Montage = require("montage/core/core").Montage; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.MenuData = Montage.create(Component, { + + _currentDocument: { + value : null + }, + + currentDocument : { + get : function() { + return this._currentDocument; + }, + set : function(value) { + if (value === this._currentDocument) { + return; + } + + this._currentDocument = value; + + this.documentEnabledIndices.forEach(function(index) { + index.enabled = true; + }); + + } + }, + + didCreate: { + value: function() { + var self = this; + + this.topLevelMenu.forEach(function(item) { + item.entries.forEach(function(entry) { + if(entry.depend && entry.depend === "document") { + self.documentEnabledIndices.push(entry); + } + }); + }); + } + }, + + documentEnabledIndices: { + value: [] + }, -exports.MenuData = Montage.create( Montage, { topLevelMenu: { value: [ { @@ -33,65 +75,47 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Close File", "hasSubMenu" : false, - "enabled": { - "value": false, - "boundObj": "documentController", - "boundProperty": "_documents.count()", - "oneway": true - }, + "enabled": false, + "depend": "document", "action": "executeFileClose" }, { "displayText" : "Close All", "hasSubMenu" : false, - "enabled": { - "value": false, - "boundObj": "documentController", - "boundProperty": "_documents.count()", - "oneway": true - }, + "enabled": false, + "depend": "document", "action": "executeFileCloseAll" }, { "displayText" : "", - "separator": true + "separator": true, + "enabled": true }, { "displayText" : "Save", "hasSubMenu" : false, - "enabled": { - "value": false, - "boundObj": "documentController", - "boundProperty": "_documents.count()", - "oneway": true - }, + "enabled": false, + "depend": "document", "action": "executeSave" }, { "displayText" : "Save As", "hasSubMenu" : false, - "enabled": { - "value": false, - "boundObj": "documentController", - "boundProperty": "_documents.count()", - "oneway": true - }, + "enabled": false, + "depend": "document", "action":"executeSaveAs" }, { "displayText" : "Save All", "hasSubMenu" : false, - "enabled": { - "value": false, - "boundObj": "documentController", - "boundProperty": "_documents.count()", - "oneway": true - }, + "enabled": false, + "depend": "document", "action": "executeSaveAll" }, { "displayText" : "", - "separator": true + "separator": true, + "enabled": true }, { "displayText" : "Open Project", @@ -107,14 +131,6 @@ exports.MenuData = Montage.create( Montage, { "displayText" : "Close Project", "hasSubMenu" : false, "enabled": false - }, - { - "displayText" : "", - "separator": true - }, - { - "displayText" : "", - "separator": true } ] }, @@ -124,7 +140,8 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Undo", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "newenabled": { "value": false, "boundObj": "undocontroller", "boundProperty": "canUndo", @@ -135,7 +152,8 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Redo", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "newenabled": { "value": false, "boundObj": "undocontroller", "boundProperty": "canRedo", @@ -166,7 +184,9 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Live Preview", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "depend": "document", + "newenabled": { "value": false, "boundObj": "documentController", "boundProperty": "activeDocument", @@ -183,7 +203,9 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Chrome Preview", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "depend": "document", + "newenabled": { "value": false, "boundObj": "documentController", "boundProperty": "activeDocument", @@ -200,7 +222,9 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Layout View", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "depend": "document", + "newenabled": { "value": false, "boundObj": "documentController", "boundProperty": "activeDocument", @@ -246,7 +270,9 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Snap", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "depend": "document", + "newenabled": { "value": false, "boundObj": "documentController", "boundProperty": "activeDocument", @@ -264,7 +290,8 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Snap To", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "newenabled": { "value": true, "boundObj": "appModel", "boundProperty": "snap", @@ -304,7 +331,9 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Show 3D Grid", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "depend": "document", + "newenabled": { "value": false, "boundObj": "documentController", "boundProperty": "activeDocument", @@ -320,12 +349,15 @@ exports.MenuData = Montage.create( Montage, { }, { "displayText" : "", - "separator": true + "separator": true, + "enabled": true }, { "displayText" : "Front View", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "depend": "document", + "newenabled": { "value": false, "boundObj": "documentController", "boundProperty": "activeDocument", @@ -343,7 +375,9 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Top View", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "depend": "document", + "newenabled": { "value": false, "boundObj": "documentController", "boundProperty": "activeDocument", @@ -361,7 +395,9 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Side View", "hasSubMenu" : false, - "enabled": { + "enabled": false, + "depend": "document", + "newenabled": { "value": false, "boundObj": "documentController", "boundProperty": "activeDocument", @@ -378,7 +414,8 @@ exports.MenuData = Montage.create( Montage, { }, { "displayText" : "", - "separator": true + "separator": true, + "enabled": true }, { "displayText" : "Debug", -- cgit v1.2.3 From ca902f0bff569ad441ca4556a7d96500e732a0a4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 5 Jun 2012 21:37:49 -0700 Subject: disabling the menu when closing all files Signed-off-by: Valerio Virgillito --- js/data/menu-data.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'js/data') diff --git a/js/data/menu-data.js b/js/data/menu-data.js index 6c597542..b6350893 100755 --- a/js/data/menu-data.js +++ b/js/data/menu-data.js @@ -24,9 +24,15 @@ exports.MenuData = Montage.create(Component, { this._currentDocument = value; - this.documentEnabledIndices.forEach(function(index) { - index.enabled = true; - }); + if(!this._currentDocument) { + this.documentEnabledIndices.forEach(function(index) { + index.enabled = false; + }); + } else { + this.documentEnabledIndices.forEach(function(index) { + index.enabled = true; + }); + } } }, -- cgit v1.2.3 From 763baf19f032c6fbae18963402b79d5d5510d923 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Thu, 7 Jun 2012 09:49:02 -0700 Subject: change the PI to make it look like the fill color affects the brush stroke color --- js/data/pi/pi-data.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/data') diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js index 157cbc64..c6cbc3cf 100755 --- a/js/data/pi/pi-data.js +++ b/js/data/pi/pi-data.js @@ -703,13 +703,14 @@ exports.PiData = Montage.create( Montage, { { type : "color", prop: "border", - id : "stroke" + id : "stroke", + visible: false }, { type : "color", id : "fill", prop: "background", - visible : false, + visible : true, divider : true } ], -- cgit v1.2.3 From e3f00a9957a3446bb6b85f54f4cd06fe2fe15940 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Thu, 7 Jun 2012 10:47:16 -0700 Subject: change units for smoothing and calligraphic angle in PI --- js/data/pi/pi-data.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/data') diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js index c6cbc3cf..92d70141 100755 --- a/js/data/pi/pi-data.js +++ b/js/data/pi/pi-data.js @@ -762,7 +762,9 @@ exports.PiData = Montage.create( Montage, { valueMutator: parseFloat, min : 0, max : 100, - value : 0 + value : 0, + acceptableUnits: [" "], + unit: " " } ] ] @@ -789,6 +791,7 @@ exports.PiData = Montage.create( Montage, { min : -90, max : 90, value : 0, + acceptableUnits: ["deg."], unit : "deg." } ] -- cgit v1.2.3