[gnome-shell/gnome-41] popupMenu: Center labels vertically



commit bb9441c1d2953e4badce4726c77572a2158189fd
Author: Leleat <atule pm me>
Date:   Tue Jan 18 08:47:25 2022 +0100

    popupMenu: Center labels vertically
    
    (cherry picked from commit f4b75d02cc8a17c8551810a94d3fccf32bc4af7a)
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2180>

 js/ui/popupMenu.js | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index ff83d2ceb2..f9c3df0bf1 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -272,7 +272,11 @@ class PopupMenuItem extends PopupBaseMenuItem {
     _init(text, params) {
         super._init(params);
 
-        this.label = new St.Label({ text });
+        this.label = new St.Label({
+            text,
+            y_expand: true,
+            y_align: Clutter.ActorAlign.CENTER,
+        });
         this.add_child(this.label);
         this.label_actor = this.label;
     }
@@ -356,7 +360,11 @@ var PopupSwitchMenuItem = GObject.registerClass({
     _init(text, active, params) {
         super._init(params);
 
-        this.label = new St.Label({ text });
+        this.label = new St.Label({
+            text,
+            y_expand: true,
+            y_align: Clutter.ActorAlign.CENTER,
+        });
         this._switch = new Switch(active);
 
         this.accessible_role = Atk.Role.CHECK_MENU_ITEM;
@@ -374,6 +382,8 @@ var PopupSwitchMenuItem = GObject.registerClass({
         this._statusLabel = new St.Label({
             text: '',
             style_class: 'popup-status-menu-item',
+            y_expand: true,
+            y_align: Clutter.ActorAlign.CENTER,
         });
         this._statusBin.child = this._switch;
     }
@@ -442,7 +452,11 @@ class PopupImageMenuItem extends PopupBaseMenuItem {
         this._icon = new St.Icon({ style_class: 'popup-menu-icon',
                                    x_align: Clutter.ActorAlign.END });
         this.add_child(this._icon);
-        this.label = new St.Label({ text });
+        this.label = new St.Label({
+            text,
+            y_expand: true,
+            y_align: Clutter.ActorAlign.CENTER,
+        });
         this.add_child(this.label);
         this.label_actor = this.label;
 


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