20 lines
585 B
Python
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)
|