emmental/ui/pane.py

23 lines
676 B
Python

# Copyright 2021 (c) Anna Schumaker.
import lib
import playlist
import sidebar
from gi.repository import Gtk
class Pane(Gtk.Paned):
def __init__(self):
Gtk.Paned.__init__(self)
panel = playlist.Panel()
self.set_shrink_start_child(False)
self.set_start_child(sidebar.Sidebar(panel))
self.set_end_child(panel)
self.set_vexpand(True)
lib.settings.initialize("sidebar.width", 250)
self.set_position(lib.settings.get_int("sidebar.width"))
self.connect("notify::position", self.change_position)
def change_position(self, pane, param):
lib.settings.set("sidebar.width", self.get_position())