[the-board] [ui] Factor out method to append toolbar actor to MainWindow
- From: Lucas Rocha <lucasr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [the-board] [ui] Factor out method to append toolbar actor to MainWindow
- Date: Tue, 8 Feb 2011 00:10:14 +0000 (UTC)
commit 7dd1496b464e72cdbfe72d6a825acd991deaee52
Author: Lucas Rocha <lucasr gnome org>
Date: Tue Feb 8 00:07:58 2011 +0000
[ui] Factor out method to append toolbar actor to MainWindow
src/js/ui/mainWindow.js | 39 ++++++++++++++-------------------------
1 files changed, 14 insertions(+), 25 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 7d52803..f5a2fd6 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -211,14 +211,7 @@ MainWindow.prototype = {
this._mainToolbar =
new MainToolbar.MainToolbar({ context: this._context });
- this._mainToolbar.actor.depth = _LAYER_TOOLBAR;
-
- this._contentBox.append(this._mainToolbar.actor,
- Tb.BoxPackFlags.FIXED);
-
- this._contentBox.set_fixed_child_align(this._mainToolbar.actor,
- Tb.BoxAlignment.CENTER,
- Tb.BoxAlignment.START);
+ this._appendToolbar(this._mainToolbar);
this._updateActiveToolbar();
},
@@ -228,14 +221,7 @@ MainWindow.prototype = {
new SelectionToolbar.SelectionToolbar({ title: Gettext.gettext("Selection"),
visible: false });
- this._selectionToolbar.actor.depth = _LAYER_TOOLBAR;
-
- this._contentBox.append(this._selectionToolbar.actor,
- Tb.BoxPackFlags.FIXED);
-
- this._contentBox.set_fixed_child_align(this._selectionToolbar.actor,
- Tb.BoxAlignment.CENTER,
- Tb.BoxAlignment.START);
+ this._appendToolbar(this._selectionToolbar);
},
_createSpinner : function() {
@@ -269,6 +255,17 @@ MainWindow.prototype = {
mainWindow: this };
},
+ _appendToolbar : function(toolbar) {
+ toolbar.actor.depth = _LAYER_TOOLBAR;
+
+ this._contentBox.append(toolbar.actor,
+ Tb.BoxPackFlags.FIXED);
+
+ this._contentBox.set_fixed_child_align(toolbar.actor,
+ Tb.BoxAlignment.CENTER,
+ Tb.BoxAlignment.START);
+ },
+
_hideStartupBox : function() {
if (!this._startupBox) {
return;
@@ -402,16 +399,8 @@ MainWindow.prototype = {
{ mainWindow: this });
if (thingToolbar) {
- thingToolbar.actor.depth = _LAYER_TOOLBAR;
-
+ this._appendToolbar(thingToolbar);
this._toolbarsByThingId[thingId] = thingToolbar;
-
- this._contentBox.append(thingToolbar.actor,
- Tb.BoxPackFlags.FIXED);
-
- this._contentBox.set_fixed_child_align(thingToolbar.actor,
- Tb.BoxAlignment.CENTER,
- Tb.BoxAlignment.START);
}
return thingToolbar;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]