Example #1
0
        private void BuildHeader()
        {
            source_actions_align = new Gtk.Alignment(0f, .5f, 1f, 0f)
            {
                RightPadding = 0,
                LeftPadding  = 0,
                NoShowAll    = true
            };

            if (Hyena.PlatformDetection.IsMeeGo)
            {
                source_actions_align.RightPadding = 5;
                source_actions_align.TopPadding   = 5;
            }

            footer = new VBox();

            source_actions_box = new EventBox()
            {
                Visible = true
            };

            BuildSearchEntry();

            InterfaceActionService uia = ServiceManager.Get <InterfaceActionService> ();

            if (uia != null)
            {
                Gtk.Action action = uia.GlobalActions["WikiSearchHelpAction"];
                if (action != null)
                {
                    MenuItem item = new SeparatorMenuItem();
                    item.Show();
                    search_entry.Menu.Append(item);

                    item            = new ImageMenuItem(Stock.Help, null);
                    item.Activated += delegate { action.Activate(); };
                    item.Show();
                    search_entry.Menu.Append(item);
                }
            }

            source_actions_box.ShowAll();
            source_actions_align.Add(source_actions_box);
            source_actions_align.Hide();
            search_entry.Show();


            context_pane = new Banshee.ContextPane.ContextPane();
            context_pane.ExpandHandler = b => {
                SetChildPacking(content.Widget, !b, true, 0, PackType.Start);
                SetChildPacking(context_pane, b, b, 0, PackType.End);
            };

            // Top to bottom, their order is reverse of this:
            PackEnd(footer, false, false, 0);
            PackEnd(context_pane, false, false, 0);
            PackEnd(source_actions_align, false, false, 0);
            PackEnd(new ConnectedMessageBar(), false, true, 0);
        }
Example #2
0
        private void BuildHeader ()
        {
            source_actions_align = new Gtk.Alignment (0f, .5f, 1f, 0f) {
                RightPadding = 0,
                LeftPadding = 0,
                NoShowAll = true
            };

            if (Hyena.PlatformDetection.IsMeeGo) {
                source_actions_align.RightPadding = 5;
                source_actions_align.TopPadding = 5;
            }

            footer = new VBox ();

            source_actions_box = new EventBox () { Visible = true };

            BuildSearchEntry ();

            InterfaceActionService uia = ServiceManager.Get<InterfaceActionService> ();
            if (uia != null) {
                Gtk.Action action = uia.GlobalActions["WikiSearchHelpAction"];
                if (action != null) {
                    MenuItem item = new SeparatorMenuItem ();
                    item.Show ();
                    search_entry.Menu.Append (item);

                    item = new ImageMenuItem (Stock.Help, null);
                    item.Activated += delegate { action.Activate (); };
                    item.Show ();
                    search_entry.Menu.Append (item);
                }
            }

            source_actions_box.ShowAll ();
            source_actions_align.Add (source_actions_box);
            source_actions_align.Hide ();
            search_entry.Show ();


            context_pane = new Banshee.ContextPane.ContextPane ();
            context_pane.ExpandHandler = b => {
                SetChildPacking (content.Widget, !b, true, 0, PackType.Start);
                SetChildPacking (context_pane, b, b, 0, PackType.End);
            };

            // Top to bottom, their order is reverse of this:
            PackEnd (footer, false, false, 0);
            PackEnd (context_pane, false, false, 0);
            PackEnd (source_actions_align, false, false, 0);
            PackEnd (new ConnectedMessageBar (), false, true, 0);
        }
Example #3
0
        private void BuildHeader()
        {
            header = new HBox();
            footer = new VBox();

            EventBox title_box = new EventBox();

            title_label           = new Label();
            title_label.Xalign    = 0.0f;
            title_label.Ellipsize = Pango.EllipsizeMode.End;

            title_box.Add(title_label);

            // Show the source context menu when the title is right clicked
            title_box.PopupMenu += delegate {
                ServiceManager.Get <InterfaceActionService> ().SourceActions ["SourceContextMenuAction"].Activate();
            };

            title_box.ButtonPressEvent += delegate(object o, ButtonPressEventArgs press) {
                if (press.Event.Button == 3)
                {
                    ServiceManager.Get <InterfaceActionService> ().SourceActions ["SourceContextMenuAction"].Activate();
                }
            };

            header_box = new EventBox();

            BuildSearchEntry();

            search_label = new Label(Catalog.GetString("_Search:"));
            search_label.MnemonicWidget = search_entry.InnerEntry;

            header.PackStart(title_box, true, true, 0);
            header.PackStart(header_box, false, false, 0);
            header.PackStart(search_label, false, false, 5);
            header.PackStart(search_entry, false, false, 0);

            InterfaceActionService uia = ServiceManager.Get <InterfaceActionService> ();

            if (uia != null)
            {
                Gtk.Action action = uia.GlobalActions["WikiSearchHelpAction"];
                if (action != null)
                {
                    MenuItem item = new SeparatorMenuItem();
                    item.Show();
                    search_entry.Menu.Append(item);

                    item            = new ImageMenuItem(Stock.Help, null);
                    item.Activated += delegate { action.Activate(); };
                    item.Show();
                    search_entry.Menu.Append(item);
                }
            }

            header.ShowAll();
            search_entry.Show();

            PackStart(header, false, false, 0);
            PackEnd(footer, false, false, 0);

            context_pane = new Banshee.ContextPane.ContextPane();
            context_pane.ExpandHandler = b => {
                SetChildPacking(content.Widget, !b, true, 0, PackType.Start);
                SetChildPacking(context_pane, b, b, 0, PackType.End);
            };
            PackEnd(context_pane, false, false, 0);

            PackEnd(new ConnectedMessageBar(), false, true, 0);
        }
        private void BuildHeader ()
        {
            header_align = new Alignment (0.0f, 0.5f, 1.0f, 1.0f);
            if (Hyena.PlatformDetection.IsMeeGo) {
                header_align.RightPadding = 5;
                header_align.TopPadding = 5;
            }

            header = new HBox ();
            footer = new VBox ();

            default_title_box = new EventBox ();
            title_label = new Label ();
            title_label.Xalign = 0.0f;
            title_label.Ellipsize = Pango.EllipsizeMode.End;

            default_title_box.Add (title_label);

            // Show the source context menu when the title is right clicked
            default_title_box.PopupMenu += delegate {
                ServiceManager.Get<InterfaceActionService> ().SourceActions ["SourceContextMenuAction"].Activate ();
            };

            default_title_box.ButtonPressEvent += delegate (object o, ButtonPressEventArgs press) {
                if (press.Event.Button == 3) {
                    ServiceManager.Get<InterfaceActionService> ().SourceActions ["SourceContextMenuAction"].Activate ();
                }
            };

            header_box = new EventBox ();

            custom_title_box = new HBox () { Visible = false };

            BuildSearchEntry ();

            header.PackStart (default_title_box, true, true, 0);
            header.PackStart (custom_title_box, true, true, 0);
            header.PackStart (header_box, false, false, 0);
            header.PackStart (search_entry, false, false, 0);

            InterfaceActionService uia = ServiceManager.Get<InterfaceActionService> ();
            if (uia != null) {
                Gtk.Action action = uia.GlobalActions["WikiSearchHelpAction"];
                if (action != null) {
                    MenuItem item = new SeparatorMenuItem ();
                    item.Show ();
                    search_entry.Menu.Append (item);

                    item = new ImageMenuItem (Stock.Help, null);
                    item.Activated += delegate { action.Activate (); };
                    item.Show ();
                    search_entry.Menu.Append (item);
                }
            }

            header_align.Add (header);
            header_align.ShowAll ();
            search_entry.Show ();

            PackStart (header_align, false, false, 0);
            PackEnd (footer, false, false, 0);

            context_pane = new Banshee.ContextPane.ContextPane ();
            context_pane.ExpandHandler = b => {
                SetChildPacking (content.Widget, !b, true, 0, PackType.Start);
                SetChildPacking (context_pane, b, b, 0, PackType.End);
            };
            PackEnd (context_pane, false, false, 0);

            PackEnd (new ConnectedMessageBar (), false, true, 0);
        }