aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-01-20 17:31:38 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2016-01-20 17:31:38 +0000
commit764dae61d64c6523383caf28d41f288687c782c8 (patch)
tree6cae237777ab93703e68de77167dcb2e488e84f4
parent29126b7d80f2385a884c79d91bd816bf4a0b27e2 (diff)
parentde4fc7e57131d28291d64cedb931b83528dd4df2 (diff)
downloadayatana-indicator-sound-764dae61d64c6523383caf28d41f288687c782c8.tar.gz
ayatana-indicator-sound-764dae61d64c6523383caf28d41f288687c782c8.tar.bz2
ayatana-indicator-sound-764dae61d64c6523383caf28d41f288687c782c8.zip
Fixing the playback controls when we have the playlist as the last item in the player section.
As number of items was 3 when having the playlist section we were not updating the player controls and the next/previous buttons were not working at all. Fixes: #1245495
-rw-r--r--src/sound-menu.vala7
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);
}
}