示例#1
0
        private void BuildNowPlaying()
        {
            var box = new HeaderBox()
            {
                Title = Catalog.GetString("Now Playing")
            };

            var seek_slider = new ConnectedSeekSlider(SeekSliderLayout.Horizontal);

            seek_slider.StreamPositionLabel.FormatString = "<small>{0}</small>";

            track_info_display = new TrackInfoDisplay()
            {
                HeightRequest = 64,
                NoShowAll     = true
            };

            track_view = new TerseTrackListView()
            {
                Name         = "media-panel-tracks",
                WidthRequest = 220
            };
            track_view.ColumnController.Insert(new Column(null, "indicator",
                                                          new ColumnCellStatusIndicator(null), 0.05, true, 20, 20), 0);

            box.PackStartHighlighted(track_info_display, false, false, 0, HeaderBox.HighlightFlags.Background);
            box.PackStartHighlighted(seek_slider, false, false, 0, HeaderBox.HighlightFlags.Background);
            box.PackStart(SetupView(track_view), true, true, 0);
            box.PackStartHighlighted(new PlaybackBox(), false, false, 0, HeaderBox.HighlightFlags.TopLine);
            box.Vexpand = true;
            box.Valign  = Align.Fill;

            Attach(box, 1, 0, 1, 1);
        }
示例#2
0
        private void BuildLibrary()
        {
            var box = new HeaderBox()
            {
                Title = Catalog.GetString("Library")
            };

            // Build the Library Header
            var header = new HBox()
            {
                Spacing     = 5,
                BorderWidth = 5
            };

            var app_button = new Button(new Image()
            {
                IconSize = (int)IconSize.LargeToolbar,
                IconName = "media-player-banshee"
            })
            {
                TooltipText = Catalog.GetString("Launch the Banshee Media Player")
            };

            app_button.Clicked += (o, e) => {
                ServiceManager.SourceManager.SetActiveSource(ServiceManager.SourceManager.MusicLibrary);
                ServiceManager.Get <MediaPanelService> ().PresentPrimaryInterface();
            };

            header.PackStart(source_combo_box = new SourceComboBox(), false, false, 0);
            header.PackStart(app_button, false, false, 0);
            header.PackStart(search_entry = new SearchEntry(), true, true, 0);
            box.PackStartHighlighted(header, false, false, 0, HeaderBox.HighlightFlags.Background);

            // Build the Library Views
            var pane = new Paned(Orientation.Horizontal);

            pane.Pack1(SetupView(artist_view = new ArtistListView()
            {
                Name                 = "media-panel-artists",
                WidthRequest         = 150,
                DoNotRenderNullModel = true
            }), false, false);
            pane.Pack2(SetupView(album_view = new AlbumListView()
            {
                Name = "media-panel-albums",
                DoNotRenderNullModel = true
            }), true, true);
            box.PackStart(pane, true, true, 0);
            box.Hexpand = box.Vexpand = true;
            box.Halign  = box.Valign = Align.Fill;

            Attach(box, 0, 0, 1, 1);
        }