Fix #5560 - Gitlive - branching wip
[gitlive] / old_seed_version / Browser / Tab.js
1 Gtk = imports.gi.Gtk;
2 GObject = imports.gi.GObject;
3
4
5 Browser = {
6     //Toolbar : imports.Toolbar.Browser.Toolbar,
7     View    : imports.View.Browser.View,
8     //Statusbar : imports.Statusbar.Browser.Statusbar
9 };
10
11  
12
13 Browser.Tab = new GType({
14     parent: Gtk.VBox.type,
15     name: "BrowserTab",
16     properties: [{name: "web_view",
17                   type: GObject.TYPE_OBJECT,
18                   nick: "WebView",
19                   blurb: "The tab's represented BrowserView",
20                   object_type: Browser.View,
21                   flags: (GObject.ParamFlags.CONSTRUCT | GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE)}],
22     init: function (self)
23     {
24         // Private
25         //var toolbar = new Browser.Toolbar();
26         var scroll_view = new Gtk.ScrolledWindow();
27         //var statusbar = new Browser.Statusbar();
28         var tab_label;
29
30         // Public
31         this.get_toolbar = function ()
32         {
33             return toolbar;
34         };
35
36         this.get_web_view = function ()
37         {
38             return self.web_view;
39         };
40
41         this.set_tab_label = function (new_tab_label)
42         {
43             tab_label = new_tab_label;
44         };
45
46         this.get_tab_label = function ()
47         {
48             return tab_label;
49         };
50 /*
51         this.get_statusbar = function ()
52         {
53             return statusbar;
54         };
55 */
56         // Implementation
57         if(this.web_view == null)
58                 this.web_view = new Browser.View();
59         
60         //this.web_view.set_tab(this);
61
62         scroll_view.smooth_scroll = true;
63         scroll_view.add(this.web_view);
64         scroll_view.set_policy(Gtk.PolicyType.AUTOMATIC,
65                                Gtk.PolicyType.AUTOMATIC);
66
67         //this.pack_start(toolbar);
68         this.pack_start(scroll_view, true, true);
69         //this.pack_start(statusbar);
70         this.show_all();
71     }
72 });