public TitledList(string title_str)
            : base()
        {
            genre_map = new Dictionary<string, Genre> ();
            title = new Label ();
            title.Xalign = 0;
            title.Ellipsize = Pango.EllipsizeMode.End;
            title.Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (title_str));

            PackStart (title, false, false, 0);
            title.Show ();

            StyleSet += delegate {
                title.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                title.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
            };

            tile_view = new TileView (2);
            PackStart (tile_view, true, true, 0);
            tile_view.Show ();

            StyleSet += delegate {
                tile_view.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                tile_view.ModifyFg (StateType.Normal, Style.Base (StateType.Normal));
            };
        }
Example #2
0
        public YouTubePane(ContextPage context_page)
            : base()
        {
            this.yt_context_page = context_page;

            results_tv = new TileView (max_results_display);

            Add (results_tv);
            ShowAll ();
        }
Example #3
0
        public RecommendationPane(ContextPage contextPage)
            : base()
        {
            this.context_page = contextPage;
            main_box = this;
            main_box.BorderWidth = 5;

            artist_box = new TitledList (Catalog.GetString ("Recommended Artists"));
            artist_box.ShowAll ();
            similar_artists_view = new TileView (2);
            similar_artists_view_sw = new Gtk.ScrolledWindow ();
            similar_artists_view_sw.SetPolicy (PolicyType.Never, PolicyType.Automatic);
            similar_artists_view_sw.Add (similar_artists_view);
            similar_artists_view_sw.ShowAll ();
            artist_box.PackStart (similar_artists_view_sw, true, true, 0);

            album_box  = new TitledList (null);
            album_box.TitleWidthChars = 25;
            album_box.SizeAllocated += OnSideSizeAllocated;
            album_list = new VBox ();
            album_box.PackStart (album_list, false, false, 0);

            track_box  = new TitledList (null);
            track_box.SizeAllocated += OnSideSizeAllocated;
            track_box.TitleWidthChars = 25;
            track_list = new VBox ();
            track_box.PackStart (track_list, true, true, 0);

            no_artists_pane = new MessagePane ();
            no_artists_pane.NoShowAll = true;
            no_artists_pane.Visible = false;
            string no_results_message;

            if (!ApplicationContext.Debugging) {
                no_artists_pane.HeaderIcon = IconThemeUtils.LoadIcon (48, "face-sad", Stock.DialogError);
                no_results_message = Catalog.GetString("No similar artists found");
            } else {
                no_artists_pane.HeaderIcon = Gdk.Pixbuf.LoadFromResource ("no-results.png");
                no_results_message = "No one likes your music, fool!";
            }

            no_artists_pane.HeaderMarkup = String.Format ("<big><b>{0}</b></big>", GLib.Markup.EscapeText (no_results_message));
            artist_box.PackEnd (no_artists_pane, true, true, 0);

            main_box.PackStart (artist_box, true, true, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (album_box, false, false, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (track_box, false, false, 5);

            no_artists_pane.Hide ();
        }
Example #4
0
        public void Refresh ()
        {
            tile_map.Clear ();

            if (contacts_view == null) {
                contacts_view = new TileView (1);
            }

            if (contacts == null) {
                contacts = new TitledList (AddinManager.CurrentLocalizer.GetString ("Contacts"));
                contacts.PackStart (contacts_view, true, true, 0);
                contacts_view.Show ();

                contacts.StyleSet += delegate {
                    contacts_view.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                    contacts_view.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
                };
            }

            while (main_box.Children.Length != 0) {
                main_box.Remove (main_box.Children[0]);
            }

            main_box.PackStart (contacts, false, false, 0);

            contacts_view.ClearWidgets ();
            foreach (Connection conn in source.TelepathyService.GetActiveConnections ()) {
                AppendToList (conn);
            }

            ShowAll ();
        }
        private void CreateWidget()
        {
            ShadowType = ShadowType.In;

            EventBox event_box = new EventBox();
            event_box.ModifyBg(StateType.Normal, Style.Base(StateType.Normal));

            main_box = new HBox();
            main_box.BorderWidth = 5;

            similar_box = new VBox(false, 3);
            tracks_box = new VBox(false, 3);
            albums_box = new VBox(false, 3);

            Label similar_header = new Label();
            similar_header.Xalign = 0;
            similar_header.Ellipsize = Pango.EllipsizeMode.End;
            similar_header.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(
                Catalog.GetString("Recommended Artists")));
            similar_box.PackStart(similar_header, false, false, 0);

            tracks_header = new Label();
            tracks_header.Xalign = 0;
            tracks_header.WidthChars = 25;
            tracks_header.Ellipsize = Pango.EllipsizeMode.End;
            tracks_box.PackStart(tracks_header, false, false, 0);

            albums_header = new Label();
            albums_header.Xalign = 0;
            albums_header.WidthChars = 25;
            albums_header.Ellipsize = Pango.EllipsizeMode.End;
            albums_box.PackStart(albums_header, false, false, 0);

            similar_artists_view = new TileView(2);
            similar_artists_view.ModifyBg(StateType.Normal, Style.Base(StateType.Normal));
            similar_artists_view_sw = new ScrolledWindow();
            similar_artists_view_sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            similar_artists_view_sw.Add(similar_artists_view);
            similar_artists_view_sw.ShowAll();
            similar_box.PackEnd(similar_artists_view_sw, true, true, 0);

            no_artists_pane = new MessagePane();
            string no_results_message;

            if(!Globals.ArgumentQueue.Contains("debug")) {
                no_artists_pane.HeaderIcon = IconThemeUtils.LoadIcon(48, "face-sad", Stock.DialogError);
                no_results_message = Catalog.GetString("No similar artists found");
            } else {
                no_artists_pane.HeaderIcon = Gdk.Pixbuf.LoadFromResource("no-results.png");
                no_results_message = "No one likes your music, fool!";
            }

            no_artists_pane.HeaderMarkup = String.Format("<big><b>{0}</b></big>",
                GLib.Markup.EscapeText(no_results_message));
            similar_box.PackEnd(no_artists_pane, true, true, 0);

            tracks_items_box = new VBox(false, 0);
            tracks_box.PackEnd(tracks_items_box, true, true, 0);

            albums_items_box = new VBox(false, 0);
            albums_box.PackEnd(albums_items_box, true, true, 0);

            main_box.PackStart(similar_box, true, true, 5);
            main_box.PackStart(new VSeparator(), false, false, 0);
            main_box.PackStart(tracks_box, false, false, 5);
            main_box.PackStart(new VSeparator(), false, false, 0);
            main_box.PackStart(albums_box, false, false, 5);

            event_box.Add(main_box);
            Add(event_box);
        }