summaryrefslogtreecommitdiff
path: root/src/gui/pieList.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-05-03 07:25:37 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-05-03 07:25:37 +0200
commita1c05d93bbb3c1bdb0c0fed9d7110804037cfd55 (patch)
treecb97ed3768912934cfc0e817beca620200d91993 /src/gui/pieList.vala
parent5478fe2ceb86715f4ab9a51eb97c517465febfa6 (diff)
Imported Upstream version 0.6.2upstream/0.6.2
Diffstat (limited to 'src/gui/pieList.vala')
-rw-r--r--src/gui/pieList.vala14
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);
}
}