~njpatel/gwibber/libgwibber-o-client-njpatel

« back to all changes in this revision

Viewing changes to client/tab-bar-item.vala

  • Committer: Neil Jagdish Patel
  • Date: 2011-06-19 13:26:59 UTC
  • Revision ID: neil.patel@canonical.com-20110619132659-e9ptu868rxk387b9
Some fixes for tabbar rendering

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Authored by Neil Jagdish Patel <njpatel@gmail.com>
17
17
 */
18
18
 
19
 
public class TabBarItem : Gtk.ToggleButton
 
19
public class TabBarItem : Gtk.Button
20
20
{
21
21
  public string stream  { get; construct set; }
22
22
  public string tooltip { get; construct set; }
23
 
 
24
 
  public TabBarItem (string stream, string icon, string tooltip = "")
 
23
  public string icon_name { get; construct set; }
 
24
 
 
25
  public bool active {
 
26
    get { return _active; }
 
27
    set
 
28
    {
 
29
      _active = value;
 
30
      queue_draw ();
 
31
    }
 
32
  } 
 
33
 
 
34
  private Gtk.Image _image;
 
35
 
 
36
  private bool _active = false;
 
37
 
 
38
  public TabBarItem (string stream, string icon_name, string tooltip = "")
25
39
  {
26
 
    //FIXME: This is temporary
27
 
    var image = new Gtk.Image.from_icon_name (icon, Gtk.IconSize.BUTTON);
28
 
 
29
 
    Object (stream:stream, image:image, tooltip:tooltip, relief:Gtk.ReliefStyle.NONE);
 
40
    Object (stream:stream, tooltip:tooltip, icon_name:icon_name);
30
41
  }
31
42
 
32
43
  construct
33
44
  {
 
45
    _image = new Gtk.Image.from_icon_name (icon_name, Gtk.IconSize.BUTTON);
 
46
    add (_image);
 
47
  }
 
48
 
 
49
  public override bool draw (Cairo.Context cr)
 
50
  {
 
51
    propagate_draw (_image, cr);
 
52
    return true;
34
53
  }
35
54
}