2021-06-09 08:55:40 -04:00
|
|
|
# Copyright 2021 (c) Anna Schumaker.
|
2021-10-12 17:16:47 -04:00
|
|
|
import lib
|
2021-06-29 11:22:10 -04:00
|
|
|
import playlist
|
2021-06-16 09:47:07 -04:00
|
|
|
import sidebar
|
2021-10-12 17:16:47 -04:00
|
|
|
from gi.repository import Gtk
|
|
|
|
|
|
|
|
class Pane(Gtk.Paned):
|
|
|
|
def __init__(self):
|
|
|
|
Gtk.Paned.__init__(self)
|
2021-11-04 14:55:08 -04:00
|
|
|
panel = playlist.Panel()
|
2021-06-09 08:55:40 -04:00
|
|
|
|
2021-10-12 17:16:47 -04:00
|
|
|
self.set_shrink_start_child(False)
|
2021-11-04 14:55:08 -04:00
|
|
|
self.set_start_child(sidebar.Sidebar(panel))
|
|
|
|
self.set_end_child(panel)
|
2021-10-12 17:16:47 -04:00
|
|
|
self.set_vexpand(True)
|
2021-06-09 08:55:40 -04:00
|
|
|
|
2021-10-12 17:16:47 -04:00
|
|
|
lib.settings.initialize("sidebar.width", 250)
|
|
|
|
self.set_position(lib.settings.get_int("sidebar.width"))
|
|
|
|
self.connect("notify::position", self.change_position)
|
2021-06-09 08:55:40 -04:00
|
|
|
|
2021-10-12 17:16:47 -04:00
|
|
|
def change_position(self, pane, param):
|
|
|
|
lib.settings.set("sidebar.width", self.get_position())
|