~ubuntu-branches/ubuntu/precise/gwibber/precise-proposed-201212050210

« back to all changes in this revision

Viewing changes to client/tab-bar.vala

  • Committer: Package Import Robot
  • Author(s): Ken VanDine
  • Date: 2012-01-30 10:55:24 UTC
  • mfrom: (1.1.67)
  • Revision ID: package-import@ubuntu.com-20120130105524-lvj9m771qldotvi4
Tags: 3.3.3-0ubuntu1
* New upstream release
  - Fixed memory leak in ActionBoxItem (LP: #909085)
  - Fixed race conditions in async image loading while scrolling (LP: #911619)
  - Hide window while gwibber exits (Michal Hruby)
  - Improved scrolling by enclosing comments and image previews in a 
    Gtk.Expander, this fixes the tiles resizing while scrolling (LP: #875348)
  - Ported to valac-0.16
* debian/control
  - build depend on valac-0.16 

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
  }
41
41
}
42
42
 
43
 
public class TabBar : Gtk.VBox
 
43
public class TabBar : Gtk.Box
44
44
{  
45
45
  private Gtk.Alignment _align;
46
 
  private Gtk.VBox _vbox;
47
 
  private Gtk.HBox _tab_box;
48
 
  private Gtk.HBox _toolbar_box;
 
46
  private Gtk.Box _vbox;
 
47
  private Gtk.Box _tab_box;
 
48
  private Gtk.Box _toolbar_box;
49
49
 
50
50
  private Gtk.Layout _layout;
51
51
  private int _last_width;
52
52
  private int _last_height;
53
53
 
54
 
  private Gtk.HBox _view_box;
 
54
  private Gtk.Box _view_box;
55
55
  private Gtk.SizeGroup _view_group;
56
56
 
57
57
  private WriteItem _write_item;
73
73
 
74
74
  construct
75
75
  {
 
76
    set_orientation (Gtk.Orientation.VERTICAL);
76
77
    _align = new Gtk.Alignment (0.0f, 0.0f, 1.0f, 1.0f);
77
78
    _align.get_style_context ().add_class ("primary-toolbar");
78
79
    _align.get_style_context ().add_class ("toolbar");
79
80
    _align.draw.connect (on_align_draw);
80
81
    pack_start (_align, false, true, 0);
81
82
 
82
 
    _vbox = new Gtk.VBox (false, 8);
 
83
    _vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 8);
83
84
    _align.add (_vbox);
84
85
 
85
 
    _tab_box = new Gtk.HBox (false, 0);
86
 
    _vbox.pack_start (_tab_box, false, false, 0);
 
86
    _tab_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
 
87
    _vbox.add (_tab_box);
87
88
 
88
 
    _toolbar_box = new Gtk.HBox (false, 0);
89
 
    _vbox.pack_start (_toolbar_box, false, true, 0);
 
89
    _toolbar_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
 
90
    _vbox.add (_toolbar_box);
90
91
 
91
92
    _layout = new Gtk.Layout (null, null);
92
93
    pack_start (_layout, true, true, 0);
93
94
   
94
 
    _view_box = new Gtk.HBox (true, 0);
 
95
    _view_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
 
96
    _view_box.set_homogeneous (true);
95
97
    _layout.put (_view_box, 0, 0);
96
98
 
97
99
    _view_group = new Gtk.SizeGroup (Gtk.SizeGroupMode.BOTH);
208
210
  public void add_item (TabBarItem item)
209
211
  {
210
212
    item.clicked.connect (on_tab_clicked);
211
 
    _tab_box.pack_start (item, false, false, 0);
 
213
    _tab_box.add (item);
212
214
 
213
215
    if (item.get_toolbar () is Gtk.Widget)
214
216
    {
215
217
      var toolbar = item.get_toolbar ();
216
218
      toolbar.set_no_show_all (true);
217
219
      toolbar.hide ();
218
 
      _toolbar_box.pack_start (toolbar);
 
220
      _toolbar_box.add (toolbar);
219
221
    }
220
222
 
221
223
    if (item.get_view () is Gtk.Widget)
224
226
      item.entry = _entry;
225
227
      view.show ();
226
228
 
227
 
      _view_box.pack_start (view, false, false, 0);
 
229
      _view_box.add (view);
228
230
      _view_group.add_widget (view);
229
231
 
230
232
      var children = _view_box.get_children ();