[gnome-shell/wip/aggregate-menu: 12/25] panel: Align the arrows together in the status menus
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/aggregate-menu: 12/25] panel: Align the arrows together in the status menus
- Date: Sun, 4 Aug 2013 09:53:35 +0000 (UTC)
commit 6e1cc892694bc162e7b71aedf204bbacebd51087
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sat Aug 3 08:30:46 2013 -0400
panel: Align the arrows together in the status menus
To align the arrows, we need to allocate panel buttons the full
height of the tray. Fix up all of the panel buttons to support this,
and align the arrows in the middle.
js/ui/dateMenu.js | 2 +-
js/ui/panel.js | 7 +++++--
js/ui/panelMenu.js | 9 ++-------
js/ui/status/accessibility.js | 5 ++++-
js/ui/status/keyboard.js | 8 +++++---
5 files changed, 17 insertions(+), 14 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index 85a0ade..ef8c5a7 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -49,7 +49,7 @@ const DateMenuButton = new Lang.Class({
menuAlignment = 1.0 - menuAlignment;
this.parent(menuAlignment);
- this._clockDisplay = new St.Label();
+ this._clockDisplay = new St.Label({ y_align: Clutter.ActorAlign.CENTER });
this.actor.add_actor(this._clockDisplay);
hbox = new St.BoxLayout({name: 'calendarArea' });
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 571c46e..7f5ed7a 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -616,7 +616,8 @@ const ActivitiesButton = new Lang.Class({
/* Translators: If there is no suitable word for "Activities"
in your language, you can use the word for "Overview". */
- this._label = new St.Label({ text: _("Activities") });
+ this._label = new St.Label({ text: _("Activities"),
+ y_align: Clutter.ActorAlign.CENTER });
this.actor.add_actor(this._label);
this.actor.label_actor = this._label;
@@ -868,7 +869,9 @@ const AggregateMenu = new Lang.Class({
this._indicators.add_child(this._power.indicators);
this._indicators.add_child(this._volume.indicators);
this._indicators.add_child(this._system.indicators);
- this._indicators.add_child(new St.Label({ text: '\u25BE' }));
+ this._indicators.add_child(new St.Label({ text: '\u25BE',
+ y_expand: true,
+ y_align: Clutter.ActorAlign.CENTER }));
this.menu.addMenuItem(this._volume.menu);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 5dd8d44..f6c48a4 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -86,13 +86,8 @@ const ButtonBox = new Lang.Class({
childBox.x2 = availWidth - this._minHPadding;
}
- if (natHeight <= availHeight) {
- childBox.y1 = Math.floor((availHeight - natHeight) / 2);
- childBox.y2 = childBox.y1 + natHeight;
- } else {
- childBox.y1 = 0;
- childBox.y2 = availHeight;
- }
+ childBox.y1 = 0;
+ childBox.y2 = availHeight;
child.allocate(childBox, flags);
},
diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js
index 149c84a..35d92e2 100644
--- a/js/ui/status/accessibility.js
+++ b/js/ui/status/accessibility.js
@@ -1,5 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
+const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
@@ -39,7 +40,9 @@ const ATIndicator = new Lang.Class({
this._hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' });
this._hbox.add_child(new St.Icon({ style_class: 'system-status-icon',
icon_name: 'preferences-desktop-accessibility-symbolic' }));
- this._hbox.add_child(new St.Label({ text: '\u25BE' }));
+ this._hbox.add_child(new St.Label({ text: '\u25BE',
+ y_expand: true,
+ y_align: Clutter.ActorAlign.CENTER }));
this.actor.add_child(this._hbox);
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
index 7ae01da..f202474 100644
--- a/js/ui/status/keyboard.js
+++ b/js/ui/status/keyboard.js
@@ -339,9 +339,11 @@ const InputSourceIndicator = new Lang.Class({
this._hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' });
this._hbox.add_child(this._container);
- this._hbox.add(new St.Label({ text: '\u25BE' }));
+ this._hbox.add_child(new St.Label({ text: '\u25BE',
+ y_expand: true,
+ y_align: Clutter.ActorAlign.CENTER }));
- this.actor.add(this._hbox, { y_expand: true });
+ this.actor.add_child(this._hbox);
this.actor.add_style_class_name('panel-status-button');
// All valid input sources currently in the gsettings
@@ -901,7 +903,7 @@ const InputSourceIndicator = new Lang.Class({
for (let i in this._inputSources) {
let is = this._inputSources[i];
- is.indicatorLabel.allocate_align_fill(box, 0.5, 0, false, false, flags);
+ is.indicatorLabel.allocate_align_fill(box, 0.5, 0.5, false, false, flags);
}
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]