emmental/ui/pane.py
Anna Schumaker 35e31d0553 ui: Switch over to the new sidebar.Sidebar class
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-20 10:04:54 -05:00

25 lines
756 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)
# Suppress some warnings during testing
if playlist.Box.get_parent(): playlist.Box.unparent()
self.set_shrink_start_child(False)
self.set_start_child(sidebar.Sidebar())
self.set_end_child(playlist.Box)
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())