emmental/sidebar/__init__.py
Anna Schumaker 7f31e39779 sidebar: Change the currently displayed playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00

20 lines
585 B
Python

# Copyright 2021 (c) Anna Schumaker.
from gi.repository import Gtk
from . import stack
class Sidebar(Gtk.Box):
def __init__(self, panel):
Gtk.Box.__init__(self)
self.panel = panel
switcher = stack.Switcher()
self.append(switcher)
self.append(stack.Box(switcher.get_stack()))
stak = switcher.get_stack()
stak.connect("playlist-changed", self.playlist_changed)
panel.set_playlist(stak.get_visible_child().get_selected_playlist())
def playlist_changed(self, stack, plist):
self.panel.set_playlist(plist)