Compare commits
3 Commits
citadel
...
gbsneto/fi
Author | SHA1 | Date | |
---|---|---|---|
|
5813850fe1 | ||
|
1ee73ac357 | ||
|
65cbf4aa45 |
@ -4,6 +4,7 @@ const AccountsService = imports.gi.AccountsService;
|
|||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
|
const Pango = imports.gi.Pango;
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
const GObject = imports.gi.GObject;
|
const GObject = imports.gi.GObject;
|
||||||
@ -163,18 +164,15 @@ var Indicator = class extends PanelMenu.SystemIndicator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_updateSwitchUserSubMenu() {
|
_updateSwitchUserSubMenu() {
|
||||||
this._switchUserSubMenu.label.text = this._user.get_real_name();
|
let realName = this._user.get_real_name();
|
||||||
let clutterText = this._switchUserSubMenu.label.clutter_text;
|
|
||||||
|
|
||||||
// XXX -- for some reason, the ClutterText's width changes
|
// In theory, GNOME allows creating users with names up to 255
|
||||||
// rapidly unless we force a relayout of the actor. Probably
|
// characters, but such long names look terribly bad, so limit
|
||||||
// a size cache issue or something. Moving this to be a layout
|
// to 100 and it should fit the vast majority of screen sizes.
|
||||||
// manager would be a much better idea.
|
if (realName.length > 100)
|
||||||
clutterText.get_allocation_box();
|
|
||||||
|
|
||||||
let layout = clutterText.get_layout();
|
|
||||||
if (layout.is_ellipsized())
|
|
||||||
this._switchUserSubMenu.label.text = this._user.get_user_name();
|
this._switchUserSubMenu.label.text = this._user.get_user_name();
|
||||||
|
else
|
||||||
|
this._switchUserSubMenu.label.text = realName;
|
||||||
|
|
||||||
let iconFile = this._user.get_icon_file();
|
let iconFile = this._user.get_icon_file();
|
||||||
if (iconFile && !GLib.file_test(iconFile, GLib.FileTest.EXISTS))
|
if (iconFile && !GLib.file_test(iconFile, GLib.FileTest.EXISTS))
|
||||||
@ -211,6 +209,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
|
|||||||
|
|
||||||
this._switchUserSubMenu = new PopupMenu.PopupSubMenuMenuItem('', true);
|
this._switchUserSubMenu = new PopupMenu.PopupSubMenuMenuItem('', true);
|
||||||
this._switchUserSubMenu.icon.style_class = 'system-switch-user-submenu-icon';
|
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
|
// 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
|
// the popup menu, and we can't easily connect on allocation-changed
|
||||||
|
@ -7,6 +7,7 @@ const AccountsService = imports.gi.AccountsService;
|
|||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const GObject = imports.gi.GObject;
|
const GObject = imports.gi.GObject;
|
||||||
|
const Pango = imports.gi.Pango;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
|
|
||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
@ -72,6 +73,7 @@ class UserWidgetLabel extends St.Widget {
|
|||||||
|
|
||||||
this._realNameLabel = new St.Label({ style_class: 'user-widget-label',
|
this._realNameLabel = new St.Label({ style_class: 'user-widget-label',
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_align: Clutter.ActorAlign.CENTER });
|
||||||
|
this._realNameLabel.clutter_text.ellipsize = Pango.EllipsizeMode.END;
|
||||||
this.add_child(this._realNameLabel);
|
this.add_child(this._realNameLabel);
|
||||||
|
|
||||||
this._userNameLabel = new St.Label({ style_class: 'user-widget-label',
|
this._userNameLabel = new St.Label({ style_class: 'user-widget-label',
|
||||||
|
Loading…
Reference in New Issue
Block a user