public WebBrowserShell (string name, WebView view) : base (2, 4, false)
        {
            this.name = name;
            this.view = view;

            RowSpacing = 5;

            view.LoadStatusChanged += (o, e) => {
                if (view.LoadStatus == OssiferLoadStatus.FirstVisuallyNonEmptyLayout) {
                    UpdateTitle (view.Title);

                    switch (search_clear_on_navigate_state) {
                        case 1:
                            search_clear_on_navigate_state = 2;
                            break;
                        case 2:
                            search_clear_on_navigate_state = 0;
                            search_entry.Query = String.Empty;
                            break;
                    }
                }
            };

            view.Ready += (o, e) => navigation_control.WebView = view;

            navigation_control.GoHomeEvent += (o, e) => view.GoHome ();

            Attach (navigation_control, 0, 1, 0, 1,
                AttachOptions.Shrink,
                AttachOptions.Shrink,
                0, 0);

            title.Xalign = 0.0f;
            title.Xpad = 20;
            title.Ellipsize = Pango.EllipsizeMode.End;

            Attach (title, 1, 2, 0, 1,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Shrink,
                0, 0);

            //search_entry.EmptyMessage = String.Format (Catalog.GetString ("Search the Amazon MP3 Store"));
            search_entry.SetSizeRequest (260, -1);
            // FIXME: dummy option to make the "search" icon show up;
            // we should probably fix this in the SearchEntry, but also
            // add real filter options for searching Amazon MP3 (artist,
            // album, genre, etc.)
            search_entry.AddFilterOption (0, name);
            search_entry.Show ();
            search_entry.Activated += (o, e) => {
                view.GoSearch (search_entry.Query);
                view.HasFocus = true;
                search_clear_on_navigate_state = 1;
            };
            Attach (search_entry, 3, 4, 0, 1,
                AttachOptions.Fill,
                AttachOptions.Shrink,
                0, 0);

            view_scroll.Add (view);
            view_scroll.ShadowType = ShadowType.In;

            Attach (view_scroll, 0, 4, 1, 2,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Expand | AttachOptions.Fill,
                0, 0);

            UpdateTitle (String.Format (Catalog.GetString ("Loading {0}..."), name));

            ShowAll ();
        }
Exemple #2
0
        public WebBrowserShell(string name, WebView view)
            : base(2, 3, false)
        {
            this.name = name;
            this.view = view;

            RowSpacing = 5;

            view.LoadStatusChanged += (o, e) => {
                if (view.LoadStatus == OssiferLoadStatus.FirstVisuallyNonEmptyLayout) {
                    UpdateTitle (view.Title);

                    switch (search_clear_on_navigate_state) {
                        case 1:
                            search_clear_on_navigate_state = 2;
                            break;
                        case 2:
                            search_clear_on_navigate_state = 0;
                            search_entry.Query = String.Empty;
                            break;
                    }
                }
            };

            view.Ready += (o, e) => navigation_control.WebView = view;

            navigation_control.GoHomeEvent += (o, e) => view.GoHome ();

            Attach (navigation_control, 0, 1, 0, 1,
                AttachOptions.Shrink,
                AttachOptions.Shrink,
                0, 0);

            title.Xalign = 0.0f;
            title.Xpad = 6;
            title.Ellipsize = Pango.EllipsizeMode.End;

            Attach (title, 1, 2, 0, 1,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Shrink,
                0, 0);

            search_entry.SetSizeRequest (260, -1);
            search_entry.ShowSearchIcon = true;
            search_entry.Show ();
            search_entry.Activated += (o, e) => {
                view.GoSearch (search_entry.Query);
                view.HasFocus = true;
                search_clear_on_navigate_state = 1;
            };
            Attach (search_entry, 2, 3, 0, 1,
                AttachOptions.Fill,
                AttachOptions.Shrink,
                0, 0);

            view_scroll.Add (view);
            view_scroll.ShadowType = ShadowType.In;

            Attach (view_scroll, 0, 3, 1, 2,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Expand | AttachOptions.Fill,
                0, 0);

            UpdateTitle (String.Format (Catalog.GetString ("Loading {0}..."), name));

            ShowAll ();
        }
Exemple #3
0
        public WebBrowserShell(string name, WebView view) : base(2, 3, false)
        {
            this.name = name;
            this.view = view;

            RowSpacing = 5;

            view.LoadStatusChanged += (o, e) => {
                if (view.LoadStatus == OssiferLoadStatus.FirstVisuallyNonEmptyLayout)
                {
                    UpdateTitle(view.Title);

                    switch (search_clear_on_navigate_state)
                    {
                    case 1:
                        search_clear_on_navigate_state = 2;
                        break;

                    case 2:
                        search_clear_on_navigate_state = 0;
                        search_entry.Query             = String.Empty;
                        break;
                    }
                }
            };

            view.Ready += (o, e) => navigation_control.WebView = view;

            navigation_control.GoHomeEvent += (o, e) => view.GoHome();

            Attach(navigation_control, 0, 1, 0, 1,
                   AttachOptions.Shrink,
                   AttachOptions.Shrink,
                   0, 0);

            title.Xalign    = 0.0f;
            title.Xpad      = 6;
            title.Ellipsize = Pango.EllipsizeMode.End;

            Attach(title, 1, 2, 0, 1,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Shrink,
                   0, 0);

            search_entry.SetSizeRequest(260, -1);
            search_entry.ShowSearchIcon = true;
            search_entry.Show();
            search_entry.Activated += (o, e) => {
                view.GoSearch(search_entry.Query);
                view.HasFocus = true;
                search_clear_on_navigate_state = 1;
            };
            Attach(search_entry, 2, 3, 0, 1,
                   AttachOptions.Fill,
                   AttachOptions.Shrink,
                   0, 0);

            view_scroll.Add(view);
            view_scroll.ShadowType = ShadowType.In;

            Attach(view_scroll, 0, 3, 1, 2,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Expand | AttachOptions.Fill,
                   0, 0);

            UpdateTitle(String.Format(Catalog.GetString("Loading {0}..."), name));

            ShowAll();
        }
        public WebBrowserShell(string name, WebView view) : base(2, 3, false)
        {
            this.name = name;
            this.view = view;

            RowSpacing = 5;

            view.LoadStatusChanged += (o, e) => {
                if (view.LoadStatus == OssiferLoadStatus.FirstVisuallyNonEmptyLayout)
                {
                    UpdateTitle(view.Title);

                    switch (search_clear_on_navigate_state)
                    {
                    case 1:
                        search_clear_on_navigate_state = 2;
                        break;

                    case 2:
                        search_clear_on_navigate_state = 0;
                        search_entry.Query             = String.Empty;
                        break;
                    }
                }
            };

            view.Ready += (o, e) => navigation_control.WebView = view;

            navigation_control.GoHomeEvent += (o, e) => view.GoHome();

            Attach(navigation_control, 0, 1, 0, 1,
                   AttachOptions.Shrink,
                   AttachOptions.Shrink,
                   0, 0);

            title.Xalign    = 0.0f;
            title.Xpad      = 6;
            title.Ellipsize = Pango.EllipsizeMode.End;

            Attach(title, 1, 2, 0, 1,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Shrink,
                   0, 0);

            //search_entry.EmptyMessage = String.Format (Catalog.GetString ("Search the Amazon MP3 Store"));
            search_entry.SetSizeRequest(260, -1);
            // FIXME: dummy option to make the "search" icon show up;
            // we should probably fix this in the SearchEntry, but also
            // add real filter options for searching Amazon MP3 (artist,
            // album, genre, etc.)
            search_entry.AddFilterOption(0, name);
            search_entry.Show();
            search_entry.Activated += (o, e) => {
                view.GoSearch(search_entry.Query);
                view.HasFocus = true;
                search_clear_on_navigate_state = 1;
            };
            Attach(search_entry, 2, 3, 0, 1,
                   AttachOptions.Fill,
                   AttachOptions.Shrink,
                   0, 0);

            view_scroll.Add(view);
            view_scroll.ShadowType = ShadowType.In;

            Attach(view_scroll, 0, 3, 1, 2,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Expand | AttachOptions.Fill,
                   0, 0);

            UpdateTitle(String.Format(Catalog.GetString("Loading {0}..."), name));

            ShowAll();
        }