[the-board] [ui] Allow setting a title on Toolbar
- From: Lucas Almeida Rocha <lucasr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [the-board] [ui] Allow setting a title on Toolbar
- Date: Sun, 7 Nov 2010 23:21:40 +0000 (UTC)
commit a6a742595578214db17fcc9bc00dc0a060f59009
Author: Lucas Rocha <lucasr gnome org>
Date: Sun Nov 7 22:55:48 2010 +0000
[ui] Allow setting a title on Toolbar
data/style/style.css | 11 +++++++++++
src/js/ui/toolbar.js | 30 +++++++++++++++++++++++++++++-
2 files changed, 40 insertions(+), 1 deletions(-)
---
diff --git a/data/style/style.css b/data/style/style.css
index 2bdc229..1099180 100644
--- a/data/style/style.css
+++ b/data/style/style.css
@@ -140,6 +140,17 @@ TbBox#toolbar-content-box {
spacing: 35px;
}
+TbBox#toolbar-title-box {
+ background-color: #AAAAAA;
+ padding: 5px 12px 0px 12px;
+}
+
+MxLabel#toolbar-title-label {
+ color: black;
+ font-size: 18px;
+ font-family: "Action Man";
+}
+
/* ToolBox */
TbBox#tool-box-main-box {
diff --git a/src/js/ui/toolbar.js b/src/js/ui/toolbar.js
index 42fd898..98ad840 100644
--- a/src/js/ui/toolbar.js
+++ b/src/js/ui/toolbar.js
@@ -4,8 +4,9 @@ const Signals = imports.signals;
const Tweener = imports.tweener.tweener;
// gi imports
-const Tb = imports.gi.Tb;
const Clutter = imports.gi.Clutter;
+const Mx = imports.gi.Mx;
+const Tb = imports.gi.Tb;
// ui imports
const ToolBox = imports.ui.toolBox;
@@ -41,6 +42,15 @@ Toolbar.prototype = {
this._toolBoxes = [];
this._createMainBox();
+
+ if ('title' in args) {
+ let title = args.title;
+
+ if (title) {
+ this._createTitleBox(title);
+ }
+ }
+
this._createContentBox();
},
@@ -64,6 +74,24 @@ Toolbar.prototype = {
Tb.BoxPackFlags.EXPAND);
},
+ _createTitleBox : function(title) {
+ this._titleBox =
+ new Tb.Box({ orientation: Tb.BoxOrientation.HORIZONTAL,
+ xAlign: Tb.BoxAlignment.CENTER,
+ yAlign: Tb.BoxAlignment.CENTER,
+ name: "toolbar-title-box" });
+
+ this._titleLabel =
+ new Mx.Label({ text: title.toUpperCase(),
+ name: "toolbar-title-label" });
+
+ this._titleBox.append(this._titleLabel,
+ Tb.BoxPackFlags.EXPAND);
+
+ this._mainBox.append(this._titleBox,
+ Tb.BoxPackFlags.EXPAND);
+ },
+
_setActiveToolBox : function(toolBox) {
if (this._activeToolBox === toolBox) {
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]