This commit is contained in:
Benjamin Schaaf
2021-02-14 01:32:55 +11:00
parent 14a7b2bb77
commit 9fe6cb4519
2 changed files with 16 additions and 12 deletions

View File

@@ -89,7 +89,7 @@ class MainWindow(Gtk.ApplicationWindow):
self.titlebar = self._create_headerbar(self.stack)
self.set_titlebar(self.titlebar)
drawer = Handy.Flap(orientation=Gtk.Orientation.VERTICAL, fold_policy=Handy.FlapFoldPolicy.ALWAYS, flap_position=Gtk.PackType.END)
drawer = Handy.Flap(orientation=Gtk.Orientation.VERTICAL, fold_policy=Handy.FlapFoldPolicy.ALWAYS, flap_position=Gtk.PackType.END, modal=False)
notification_container = Gtk.Overlay()
notification_container.add(self.stack)

View File

@@ -98,7 +98,7 @@ class PlaylistsPanel(Handy.Leaflet):
}
def __init__(self, *args, **kwargs):
Gtk.Paned.__init__(self, orientation=Gtk.Orientation.HORIZONTAL)
Gtk.Paned.__init__(self, transition_type=Handy.LeafletTransitionType.SLIDE, can_swipe_forward=False, interpolate_size=False)
list_sizer = Sizer(natural_width=400)
self.playlist_list = PlaylistList()
@@ -405,6 +405,13 @@ class PlaylistDetailPanel(Gtk.Overlay):
self.playlist_box.add(action_bar)
self.error_container = Gtk.Box()
self.playlist_box.add(self.error_container)
self.scrolled_window = Gtk.ScrolledWindow()
scrolled_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
playlist_info_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.playlist_artwork = SpinnerImage(
@@ -433,14 +440,9 @@ class PlaylistDetailPanel(Gtk.Overlay):
playlist_info_box.pack_start(playlist_details_box, True, True, 0)
self.playlist_box.add(playlist_info_box)
self.error_container = Gtk.Box()
self.playlist_box.add(self.error_container)
scrolled_box.add(playlist_info_box)
# Playlist songs list
self.playlist_song_scroll_window = Gtk.ScrolledWindow()
self.playlist_song_store = Gtk.ListStore(
bool, # clickable
str, # cache status
@@ -500,9 +502,11 @@ class PlaylistDetailPanel(Gtk.Overlay):
)
self.playlist_song_store.connect("row-deleted", self.on_playlist_model_row_move)
self.playlist_song_scroll_window.add(self.playlist_songs)
scrolled_box.pack_start(self.playlist_songs, True, True, 0)
self.scrolled_window.add(scrolled_box)
self.playlist_box.pack_start(self.scrolled_window, True, True, 0)
self.playlist_box.pack_start(self.playlist_song_scroll_window, True, True, 0)
self.add(self.playlist_box)
playlist_view_spinner = Gtk.Spinner(active=True)
@@ -595,10 +599,10 @@ class PlaylistDetailPanel(Gtk.Overlay):
self.error_container.pack_start(load_error, True, True, 0)
self.error_container.show_all()
if not has_data:
self.playlist_song_scroll_window.hide()
self.scrolled_window.hide()
else:
self.error_container.hide()
self.playlist_song_scroll_window.show()
self.scrolled_window.show()
# Update the song list model. This requires some fancy diffing to
# update the list.