5
namespace Beagle.Search.Tiles {
7
public abstract class TileTemplate : Tile {
9
private Gtk.Label title_label;
10
private Gtk.Label desc_label;
12
public TileTemplate (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
14
Alignment alignment = new Alignment (0.0f, 0.5f, 1.0f, 0.0f);
15
HBox.PackStart (alignment, true, true, 0);
17
VBox vbox = new VBox (false, 0);
20
title_label = WidgetFu.NewLabel ();
21
title_label.LineWrap = true;
22
WidgetFu.EllipsizeLabel (title_label, 30);
23
vbox.PackStart (title_label, false, false, 0);
25
desc_label = WidgetFu.NewGrayLabel ();
26
desc_label.NoShowAll = true;
27
WidgetFu.EllipsizeLabel (desc_label, 30);
28
vbox.PackStart (desc_label, false, false, 0);
33
protected override void OnRealized ()
37
if ((Icon.StorageType == ImageType.Empty || Icon.StorageType == ImageType.Pixbuf) &&
42
public override string Title {
43
get { return base.Title; }
46
title_label.Markup = "<span weight=\"bold\">" + GLib.Markup.EscapeText (value) + "</span>";
50
private string description;
51
public string Description {
52
get { return description; }
56
if (description != null) {
57
desc_label.Markup = "<small>" + GLib.Markup.EscapeText (description) + "</small>";