fixup! Port UI to GTK 4
This commit is contained in:
parent
f67da0a4a0
commit
7e21110f0a
4 changed files with 45 additions and 35 deletions
|
|
@ -159,6 +159,10 @@ class PlaylistPanel(Adw.Bin):
|
|||
self._close_standalone()
|
||||
|
||||
|
||||
def set_size(self, width, height):
|
||||
self._resize_standalone_image()
|
||||
|
||||
|
||||
def set_item_size(self, item_size):
|
||||
if self._item_size != item_size:
|
||||
self._item_size = item_size
|
||||
|
|
@ -268,15 +272,19 @@ class PlaylistPanel(Adw.Bin):
|
|||
"""Diese Methode skaliert das geladene Bild aus dem Pixelpuffer
|
||||
auf die Größe des Fensters unter Beibehalt der Seitenverhältnisse
|
||||
"""
|
||||
# Get size
|
||||
size_width = self.standalone_stack.get_width()
|
||||
size_height = self.standalone_stack.get_height()
|
||||
|
||||
# Get pixelbuffer
|
||||
pixbuf = self._standalone_pixbuf
|
||||
size = self.standalone_scroll.get_allocation()
|
||||
# Check pixelbuffer
|
||||
if pixbuf is None:
|
||||
return
|
||||
|
||||
# Skalierungswert für Breite und Höhe ermitteln
|
||||
ratioW = float(size.width) / float(pixbuf.get_width())
|
||||
ratioH = float(size.height) / float(pixbuf.get_height())
|
||||
ratioW = float(size_width) / float(pixbuf.get_width())
|
||||
ratioH = float(size_height) / float(pixbuf.get_height())
|
||||
# Kleineren beider Skalierungswerte nehmen, nicht Hochskalieren
|
||||
ratio = min(ratioW, ratioH)
|
||||
ratio = min(ratio, 1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue