[polari] userList: Ellipsize usernames



commit ebd0aa05843c9dd4b6a9cd422c8a4b227ba8ab53
Author: Jurijs KolomijecS <jurikolo yandex com>
Date:   Thu Oct 1 16:35:07 2015 +0300

    userList: Ellipsize usernames
    
    Add max_width_chars parameter to popover Gtk.Label
    
    Username ellipsizing stopped working when the parent container no longer
    enforced a fixed width, so set GtkLabel:max-width-chars for the
    username label to make ellipsizing work again
    
    https://bugzilla.gnome.org/show_bug.cgi?id=755477

 src/userList.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/userList.js b/src/userList.js
index cbfdb90..d08c696 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -13,6 +13,7 @@ const Mainloop = imports.mainloop;
 const READWRITE = GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE;
 
 const MAX_USERS_SHOWN = 8;
+const MAX_USERS_WIDTH_CHARS = 17;
 
 const UserListPopover = new Lang.Class({
     Name: 'UserListPopover',
@@ -293,7 +294,8 @@ const UserListRow = new Lang.Class({
                                       halign: Gtk.Align.START,
                                       hexpand: true,
                                       use_markup: true,
-                                      ellipsize: Pango.EllipsizeMode.END });
+                                      ellipsize: Pango.EllipsizeMode.END,
+                                      max_width_chars: MAX_USERS_WIDTH_CHARS });
         hbox.add(this._label);
         hbox.add(this._arrow);
         vbox.add(hbox);


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