fixed height allocation of AlbumPopover

This commit is contained in:
Martin Wagner 2020-12-08 18:27:49 +01:00
parent 33e57b9e7f
commit 79e7ea5973

View File

@ -1540,7 +1540,7 @@ class SongsWindow(Gtk.Box):
self._client.wrapped_call("files_to_playlist", self._songs_view.get_files(), "enqueue") self._client.wrapped_call("files_to_playlist", self._songs_view.get_files(), "enqueue")
class AlbumPopover(Gtk.Popover): class AlbumPopover(Gtk.Popover):
def __init__(self, client, settings, album, album_artist, year, relative, x, y): def __init__(self, client, settings, album, album_artist, year, widget, x, y):
super().__init__() super().__init__()
rect=Gdk.Rectangle() rect=Gdk.Rectangle()
rect.x=x rect.x=x
@ -1548,7 +1548,7 @@ class AlbumPopover(Gtk.Popover):
rect.width=1 rect.width=1
rect.height=1 rect.height=1
self.set_pointing_to(rect) self.set_pointing_to(rect)
self.set_relative_to(relative) self.set_relative_to(widget)
# adding vars # adding vars
self._client=client self._client=client
@ -1579,8 +1579,7 @@ class AlbumPopover(Gtk.Popover):
# scroll # scroll
scroll=songs_window.get_scroll() scroll=songs_window.get_scroll()
window=self.get_toplevel() scroll.set_max_content_height(4*widget.get_allocated_height()//7)
scroll.set_max_content_height(window.get_size()[1]//3)
scroll.set_propagate_natural_height(True) scroll.set_propagate_natural_height(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.set_property("margin-start", 3) scroll.set_property("margin-start", 3)