public PlaybackBox() { var action_service = ServiceManager.Get <InterfaceActionService> (); PackStart(action_service.PlaybackActions["PreviousAction"].CreateToolItem(), false, false, 0); PackStart(action_service.PlaybackActions["PlayPauseAction"].CreateToolItem(), false, false, 0); PackStart(new NextButton(action_service), false, false, 0); var seek_slider = new ConnectedSeekSlider(); seek_slider.Show(); PackStart(seek_slider, false, false, 0); }
private void BuildHeader() { header_table = new Table(2, 2, false); header_table.Show(); primary_vbox.PackStart(header_table, false, false, 0); main_menu = new MainMenu(); main_menu.Show(); header_table.Attach(main_menu, 0, 1, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); Alignment toolbar_alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f); toolbar_alignment.TopPadding = 3; toolbar_alignment.BottomPadding = 3; header_toolbar = (Toolbar)ActionService.UIManager.GetWidget("/HeaderToolbar"); header_toolbar.ShowArrow = false; header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; toolbar_alignment.Add(header_toolbar); toolbar_alignment.ShowAll(); header_table.Attach(toolbar_alignment, 0, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); Widget next_button = new NextButton(ActionService); next_button.Show(); ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/NextArrowButton", next_button); ConnectedSeekSlider seek_slider = new ConnectedSeekSlider(); seek_slider.Show(); ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider); TrackInfoDisplay track_info_display = new ClassicTrackInfoDisplay(); track_info_display.Show(); ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_display, true); ConnectedVolumeButton volume_button = new ConnectedVolumeButton(); volume_button.Show(); ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/VolumeButton", volume_button); }
Grid _Toolbar() { var grid = new Grid { ColumnHomogeneous = true, MarginLeft = 10, MarginRight = 10 }; var task_status = new TaskStatusIcon { ShowOnlyBackgroundTasks = false }; var toolbar = (Toolbar)ActionService.UIManager.GetWidget("/ControlToolbar"); toolbar.ShowArrow = false; toolbar.ToolbarStyle = ToolbarStyle.Icons; toolbar.IconSize = IconSize.SmallToolbar; toolbar.Margin = 0; var next_button = new NextButton(ActionService) { IconSize = IconSize.SmallToolbar }; ActionService.PopulateToolbarPlaceholder(toolbar, "/ControlToolbar/NextArrowButton", next_button); var repeat_button = new RepeatButton { Relief = ReliefStyle.None }; ActionService.PopulateToolbarPlaceholder(toolbar, "/ControlToolbar/RepeatButton", repeat_button); var seek_slider = new ConnectedSeekSlider(); var tools_align = new Alignment(0.5f, 0.5f, 0f, 0f); tools_align.Child = toolbar; var search_align = new Alignment(0.5f, 0.5f, 0f, 0f); search_align.Child = _view_container.SearchEntry; var lbox = new HBox(); lbox.PackStart(task_status, false, false, 0); lbox.PackStart(tools_align, true, true, 0); var rbox = new HBox(); rbox.PackEnd(search_align, true, true, 0); grid.Attach(lbox, 0, 0, 1, 1); grid.Attach(seek_slider, 1, 0, 1, 1); grid.Attach(rbox, 2, 0, 1, 1); _ready.Add(() => { task_status.Show(); next_button.Show(); repeat_button.Show(); tools_align.Show(); search_align.Show(); lbox.Show(); seek_slider.Show(); rbox.Show(); }); return(grid); }