diff options
Diffstat (limited to 'src/gui/pieList.vala')
-rw-r--r-- | src/gui/pieList.vala | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/pieList.vala b/src/gui/pieList.vala index 29c0a1e..77f833b 100644 --- a/src/gui/pieList.vala +++ b/src/gui/pieList.vala @@ -28,6 +28,7 @@ class PieList : Gtk.TreeView { ///////////////////////////////////////////////////////////////////// public signal void on_select(string id); + public signal void on_activate(); ///////////////////////////////////////////////////////////////////// /// Stores the data internally. @@ -65,7 +66,7 @@ class PieList : Gtk.TreeView { this.data.set_sort_column_id(DataPos.NAME, Gtk.SortType.ASCENDING); this.set_model(this.data); - this.set_headers_visible(false); + this.set_headers_visible(true); this.set_grid_lines(Gtk.TreeViewGridLines.NONE); this.width_request = 170; this.set_enable_search(false); @@ -73,12 +74,14 @@ class PieList : Gtk.TreeView { this.set_events(Gdk.EventMask.POINTER_MOTION_MASK); var main_column = new Gtk.TreeViewColumn(); + main_column.title = _("Pies"); var icon_render = new Gtk.CellRendererPixbuf(); icon_render.xpad = 4; icon_render.ypad = 4; main_column.pack_start(icon_render, false); var name_render = new Gtk.CellRendererText(); + name_render.xpad = 6; name_render.ellipsize = Pango.EllipsizeMode.END; name_render.ellipsize_set = true; main_column.pack_start(name_render, true); @@ -86,7 +89,7 @@ class PieList : Gtk.TreeView { base.append_column(main_column); main_column.add_attribute(icon_render, "pixbuf", DataPos.ICON); - main_column.add_attribute(name_render, "text", DataPos.NAME); + main_column.add_attribute(name_render, "markup", DataPos.NAME); // setup drag'n'drop Gtk.TargetEntry uri_source = {"text/uri-list", 0, 0}; @@ -101,6 +104,10 @@ class PieList : Gtk.TreeView { this.last_hover = 0; }); + this.row_activated.connect(() => { + this.on_activate(); + }); + this.get_selection().changed.connect(() => { Gtk.TreeIter active; if (this.get_selection().get_selected(null, out active)) { @@ -177,7 +184,8 @@ class PieList : Gtk.TreeView { var icon = new Icon(pie.icon, 24); this.data.set(last, DataPos.ICON, icon.to_pixbuf(), DataPos.ICON_NAME, pie.icon, - DataPos.NAME, pie.name, + DataPos.NAME,GLib.Markup.escape_text(pie.name) + "\n" + + "<span font-size='x-small'>" + PieManager.get_accelerator_label_of(pie.id) + "</span>", DataPos.ID, pie.id); } } |