From 65cbf4aa458a12211ebd22afedc82ff11fbb3985 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 7 Feb 2019 17:51:21 -0200 Subject: [PATCH] system: Ellipsize user names Users may have long user names, (but not too long [1]) so it makes sense to limit how much the label can grow. Otherwise, the popup may overflow even the biggest screens. Ellipsize the user name label. [1] https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/385 --- js/ui/status/system.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/ui/status/system.js b/js/ui/status/system.js index bbbc44ea1..b4110782e 100644 --- a/js/ui/status/system.js +++ b/js/ui/status/system.js @@ -4,6 +4,7 @@ const AccountsService = imports.gi.AccountsService; const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; +const Pango = imports.gi.Pango; const Shell = imports.gi.Shell; const St = imports.gi.St; const GObject = imports.gi.GObject; @@ -211,6 +212,7 @@ var Indicator = class extends PanelMenu.SystemIndicator { this._switchUserSubMenu = new PopupMenu.PopupSubMenuMenuItem('', true); this._switchUserSubMenu.icon.style_class = 'system-switch-user-submenu-icon'; + this._switchUserSubMenu.label.clutter_text.ellipsize = Pango.EllipsizeMode.END; // Since the label of the switch user submenu depends on the width of // the popup menu, and we can't easily connect on allocation-changed