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

« back to all changes in this revision

Viewing changes to client/tab-bar.vala

  • Committer: Neil Jagdish Patel
  • Date: 2011-06-19 12:48:27 UTC
  • mfrom: (159.2.27 client-gtk3)
  • Revision ID: neil.patel@canonical.com-20110619124827-4agvjitrl6e38q2p
Merge in kens work as well as add some updates. Should have done the merge and my work separately but I forgot to commit after the merge :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
  private Gtk.HBox _tab_box;
23
23
  private Gtk.HBox _toolbar_box;
24
24
 
 
25
  private TabBarItem? _active_item = null;
 
26
 
 
27
  public signal void tab_changed (TabBarItem item);
 
28
 
25
29
  public TabBar ()
26
30
  {
27
31
    Object ();
43
47
 
44
48
  public void add_item (TabBarItem item)
45
49
  {
 
50
    item.clicked.connect (on_tab_clicked);
46
51
    _tab_box.pack_start (item, true, true, 0);
47
52
  }
 
53
 
 
54
  public void on_tab_clicked (Gtk.Button? gtk_item)
 
55
  {
 
56
    TabBarItem? item = gtk_item as TabBarItem;
 
57
 
 
58
    if (_active_item == item)
 
59
      return;
 
60
 
 
61
    _active_item.active = false;
 
62
 
 
63
    _active_item = item;
 
64
    _active_item.active = true;
 
65
 
 
66
    tab_changed (item);
 
67
  }
48
68
}