Show total number of results for google driver too. Helps to know if my query resulte...
[beagle.git] / search / Tiles / TileTemplate.cs
blobe4c5759b2099b8b30778192194d0d5a5994a07ab
1 using System;
3 using Gtk;
5 namespace 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);
18 alignment.Add (vbox);
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);
30 alignment.ShowAll ();
33 protected override void OnRealized ()
35 base.OnRealized ();
37 if ((Icon.StorageType == ImageType.Empty || Icon.StorageType == ImageType.Pixbuf) &&
38 Icon.Pixbuf == null)
39 LoadIcon (Icon, 32);
42 public override string Title {
43 get { return base.Title; }
44 set {
45 base.Title = value;
46 title_label.Markup = "<span weight=\"bold\">" + GLib.Markup.EscapeText (value) + "</span>";
50 private string description;
51 public string Description {
52 get { return description; }
53 set {
54 description = value;
56 if (description != null) {
57 desc_label.Markup = "<small>" + GLib.Markup.EscapeText (description) + "</small>";
58 desc_label.Show ();
59 } else {
60 desc_label.Hide ();