[gnome-shell] Make dropdown arrows consistent size
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Make dropdown arrows consistent size
- Date: Fri, 11 Oct 2013 15:33:04 +0000 (UTC)
commit 63593e45a6a776bd44b596172a4e0efe99bf3e77
Author: Carlos Soriano <carlos soriano89 gmail com>
Date: Mon Oct 7 16:01:07 2013 +0200
Make dropdown arrows consistent size
Since the agregate menu does 120% of font-size, make this
for all dropdown arrows in gnome-shell and rename the css
class to make clear that it is used in overall gnome-shell
https://bugzilla.gnome.org/show_bug.cgi?id=709564
data/theme/gnome-shell.css | 2 +-
js/ui/panel.js | 8 ++------
js/ui/popupMenu.js | 29 +++++++++++++++++++++++++++--
js/ui/status/accessibility.js | 4 +---
js/ui/status/keyboard.js | 4 +---
5 files changed, 32 insertions(+), 15 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index 2523a96..feae78c 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -157,7 +157,7 @@ StScrollBar StButton#vhandle:active {
min-width: 200px;
}
-.popup-submenu-menu-item-triangle {
+.unicode-arrow {
font-size: 120%;
}
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 823df43..2337a63 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -213,9 +213,7 @@ const AppMenuButton = new Lang.Class({
this._label = new TextShadower();
this._label.actor.y_align = Clutter.ActorAlign.CENTER;
this._hbox.add_actor(this._label.actor);
- this._arrow = new St.Label({ text: '\u25BE',
- y_expand: true,
- y_align: Clutter.ActorAlign.CENTER });
+ this._arrow = PopupMenu.unicodeArrow(St.Side.BOTTOM);
this._hbox.add_actor(this._arrow);
this._iconBottomClip = 0;
@@ -833,9 +831,7 @@ const AggregateMenu = new Lang.Class({
this._indicators.add_child(this._rfkill.indicators);
this._indicators.add_child(this._volume.indicators);
this._indicators.add_child(this._power.indicators);
- this._indicators.add_child(new St.Label({ text: '\u25BE',
- y_expand: true,
- y_align: Clutter.ActorAlign.CENTER }));
+ this._indicators.add_child(PopupMenu.unicodeArrow(St.Side.BOTTOM));
this.menu.addMenuItem(this._volume.menu);
this.menu.addMenuItem(this._brightness.menu);
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index eeb777d..07ad211 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -42,6 +42,32 @@ function isPopupMenuItemVisible(child) {
return child.visible;
}
+/**
+ * @side Side to which the arrow points.
+ */
+function unicodeArrow(side) {
+ let arrowChar;
+ switch (side) {
+ case St.Side.TOP:
+ arrowChar = '\u25B4';
+ break;
+ case St.Side.RIGHT:
+ arrowChar = '\u25B8';
+ break;
+ case St.Side.BOTTOM:
+ arrowChar = '\u25BE';
+ break;
+ case St.Side.LEFT:
+ arrowChar = '\u25C2';
+ break;
+ }
+
+ return new St.Label({ text: arrowChar,
+ style_class: 'unicode-arrow',
+ y_expand: true,
+ y_align: Clutter.ActorAlign.CENTER });
+}
+
const PopupBaseMenuItem = new Lang.Class({
Name: 'PopupBaseMenuItem',
@@ -962,8 +988,7 @@ const PopupSubMenuMenuItem = new Lang.Class({
y_align: Clutter.ActorAlign.CENTER });
this.actor.add_child(this.status);
- this._triangle = new St.Label({ text: '\u25B8',
- style_class: 'popup-submenu-menu-item-triangle' });
+ this._triangle = unicodeArrow(St.Side.RIGHT);
this._triangle.pivot_point = new Clutter.Point({ x: 0.5, y: 0.6 });
this._triangleBin = new St.Widget({ y_expand: true,
diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js
index 996a24d..81c37bf 100644
--- a/js/ui/status/accessibility.js
+++ b/js/ui/status/accessibility.js
@@ -43,9 +43,7 @@ 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',
- y_expand: true,
- y_align: Clutter.ActorAlign.CENTER }));
+ this._hbox.add_child(PopupMenu.unicodeArrow(St.Side.BOTTOM));
this.actor.add_child(this._hbox);
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
index 5e93a8c..ac4ae2d 100644
--- a/js/ui/status/keyboard.js
+++ b/js/ui/status/keyboard.js
@@ -339,9 +339,7 @@ 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_child(new St.Label({ text: '\u25BE',
- y_expand: true,
- y_align: Clutter.ActorAlign.CENTER }));
+ this._hbox.add_child(PopupMenu.unicodeArrow(St.Side.BOTTOM));
this.actor.add_child(this._hbox);
this.actor.add_style_class_name('panel-status-button');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]