diff options
author | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2016-01-20 11:12:23 -0600 |
---|---|---|
committer | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2016-01-20 11:12:23 -0600 |
commit | de4fc7e57131d28291d64cedb931b83528dd4df2 (patch) | |
tree | 6cae237777ab93703e68de77167dcb2e488e84f4 | |
parent | 29126b7d80f2385a884c79d91bd816bf4a0b27e2 (diff) | |
download | ayatana-indicator-sound-de4fc7e57131d28291d64cedb931b83528dd4df2.tar.gz ayatana-indicator-sound-de4fc7e57131d28291d64cedb931b83528dd4df2.tar.bz2 ayatana-indicator-sound-de4fc7e57131d28291d64cedb931b83528dd4df2.zip |
Fixing playback controls when the player section contains the playlist
-rw-r--r-- | src/sound-menu.vala | 7 |
1 files 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); } } |