[the-board] [ui] Define initial property values on constructor where applicable



commit 1c2f2a9885b3919e53daa2c05d37418fd58287fd
Author: Lucas Rocha <lucasr gnome org>
Date:   Wed Jan 26 21:57:55 2011 +0000

    [ui] Define initial property values on constructor where applicable

 src/js/ui/thing.js |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/src/js/ui/thing.js b/src/js/ui/thing.js
index 8619ec3..ddeb49e 100644
--- a/src/js/ui/thing.js
+++ b/src/js/ui/thing.js
@@ -122,12 +122,11 @@ Thing.prototype = {
     _createLinkButton : function() {
         this._linkButton =
             new Mx.Button({ visible: false,
+                            opacity: 0,
+                            anchorX: _SHOW_CONTROLS_LENGTH,
+                            anchorY: _SHOW_CONTROLS_LENGTH,
                             name: "thing-link-button" });
 
-        this._linkButton.opacity = 0;
-        this._linkButton.anchorX = _SHOW_CONTROLS_LENGTH;
-        this._linkButton.anchorY = _SHOW_CONTROLS_LENGTH;
-
         this._linkButton.connect("clicked",
                                   Lang.bind(this, this._onLinkButtonClicked));
 
@@ -142,12 +141,11 @@ Thing.prototype = {
     _createRemoveButton : function() {
         this._removeButton =
             new Mx.Button({ visible: false,
+                            opacity: 0,
+                            anchorX: -_SHOW_CONTROLS_LENGTH,
+                            anchorY: _SHOW_CONTROLS_LENGTH,
                             name: "thing-remove-button" });
 
-        this._removeButton.opacity = 0;
-        this._removeButton.anchorX = -_SHOW_CONTROLS_LENGTH;
-        this._removeButton.anchorY = _SHOW_CONTROLS_LENGTH;
-
         this._removeButton.connect("clicked",
                                   Lang.bind(this, this._onRemoveButtonClicked));
 
@@ -161,7 +159,11 @@ Thing.prototype = {
 
     _createResizeButton : function() {
         this._resizeButton =
-            new Mx.Button({ name: "thing-resize-button" });
+            new Mx.Button({ visible: false,
+                            opacity: 0,
+                            anchorX: -_SHOW_CONTROLS_LENGTH,
+                            anchorY: -_SHOW_CONTROLS_LENGTH,
+                            name: "thing-resize-button" });
 
         let dragAction = new Clutter.DragAction();
 
@@ -177,10 +179,6 @@ Thing.prototype = {
 
         this._resizeButton.add_action(dragAction);
 
-        this._resizeButton.opacity = 0;
-        this._resizeButton.anchorX = -_SHOW_CONTROLS_LENGTH;
-        this._resizeButton.anchorY = -_SHOW_CONTROLS_LENGTH;
-
         this._mainBox.append(this._resizeButton,
                              Tb.BoxPackFlags.FIXED);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]