~ubuntu-branches/ubuntu/jaunty/beagle/jaunty-security

« back to all changes in this revision

Viewing changes to search/Beagle.Search.Tiles/TileTemplate.cs

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2008-05-04 00:31:32 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20080504003132-2tkm5o8moo5952ri
Tags: 0.3.7-2ubuntu1
 * Merge from Debian unstable. (LP: #225746) Remaining Ubuntu changes:
  - debian/control:
    + Rename ice{weasel,dove}-beagle to {mozilla,thunderbird}-beagle and
      and update the dependencies accordingly.
    + Change Maintainer to Ubuntu Mono Team.
  - debian/rules:
    + Install the mozilla-beagle and thunderbird-beagle extensions.
  - ice{dove,weasel}.dirs:
    + Renamed to {mozilla,thunderbird}-beagle.dirs.
    + Fixed paths to point to usr/lib/{firefox,thunderbird}

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
 
 
3
using Gtk;
 
4
 
 
5
namespace Beagle.Search.Tiles {
 
6
 
 
7
        public abstract class TileTemplate : Tile {
 
8
 
 
9
                private Gtk.Label title_label;
 
10
                private Gtk.Label desc_label;
 
11
                
 
12
                public TileTemplate (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
 
13
                {
 
14
                        Alignment alignment = new Alignment (0.0f, 0.5f, 1.0f, 0.0f);
 
15
                        HBox.PackStart (alignment, true, true, 0);
 
16
 
 
17
                        VBox vbox = new VBox (false, 0);
 
18
                        alignment.Add (vbox);
 
19
 
 
20
                        title_label = WidgetFu.NewLabel ();
 
21
                        title_label.LineWrap = true;
 
22
                        WidgetFu.EllipsizeLabel (title_label, 30);
 
23
                        vbox.PackStart (title_label, false, false, 0);
 
24
 
 
25
                        desc_label = WidgetFu.NewGrayLabel ();
 
26
                        desc_label.NoShowAll = true;
 
27
                        WidgetFu.EllipsizeLabel (desc_label, 30);
 
28
                        vbox.PackStart (desc_label, false, false, 0);
 
29
 
 
30
                        alignment.ShowAll ();
 
31
                }
 
32
 
 
33
                protected override void OnRealized ()
 
34
                {
 
35
                        base.OnRealized ();
 
36
 
 
37
                        if ((Icon.StorageType == ImageType.Empty || Icon.StorageType == ImageType.Pixbuf) &&
 
38
                            Icon.Pixbuf == null)
 
39
                                LoadIcon (Icon, 32);
 
40
                }
 
41
 
 
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>";
 
47
                        }
 
48
                }
 
49
 
 
50
                private string description;
 
51
                public string Description {
 
52
                        get { return description; }
 
53
                        set {
 
54
                                description = value;
 
55
 
 
56
                                if (description != null) {
 
57
                                        desc_label.Markup = "<small>" + GLib.Markup.EscapeText (description) + "</small>";
 
58
                                        desc_label.Show ();
 
59
                                } else {
 
60
                                        desc_label.Hide ();
 
61
                                }
 
62
                        }
 
63
                }
 
64
        }
 
65
}