From de4fc7e57131d28291d64cedb931b83528dd4df2 Mon Sep 17 00:00:00 2001 From: Xavi Garcia Mena Date: Wed, 20 Jan 2016 11:12:23 -0600 Subject: Fixing playback controls when the player section contains the playlist --- src/sound-menu.vala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sound-menu.vala b/src/sound-menu.vala index bdb8df2..604e484 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -339,12 +339,13 @@ public class SoundMenu: Object void update_player_section (MediaPlayer player, int index) { var player_section = this.menu.get_item_link(index, Menu.LINK_SECTION) as Menu; - if (player_section.get_n_items () == 2) { + if (player_section.get_n_items () == 2 || player_section.get_n_items () == 3) { // we have 2 items, the second one is the playback item - // remove it first + // if we have 3 items, it means we also have the playlist item. + // remove the playbak item first player_section.remove (1); MenuItem playback_item = create_playback_menu_item (player); - player_section.append_item (playback_item); + player_section.insert_item (1, playback_item); } } -- cgit v1.2.3