diff --git a/bottles/frontend/main.py b/bottles/frontend/main.py index ab4d95c65f..11dc1d4248 100644 --- a/bottles/frontend/main.py +++ b/bottles/frontend/main.py @@ -234,13 +234,13 @@ def do_activate(self): self.win = win win.present() - @staticmethod - def __quit(action=None, param=None): + def __quit(self, *args): """ This function close the application. It is used by the [Ctrl+Q] shortcut. """ logging.info(_("[Quit] request received."), ) + self.win.on_close_request() quit() @staticmethod diff --git a/bottles/frontend/ui/library-entry.blp b/bottles/frontend/ui/library-entry.blp index 5d3e5df521..47fa971bc7 100644 --- a/bottles/frontend/ui/library-entry.blp +++ b/bottles/frontend/ui/library-entry.blp @@ -32,6 +32,9 @@ template LibraryEntry : Box { vexpand: true; label: _("No Thumbnail"); + wrap: true; + wrap-mode: word_char; + styles [ "dim-label", ] diff --git a/bottles/frontend/widgets/library.py b/bottles/frontend/widgets/library.py index 8963088629..0ddbe01ffa 100644 --- a/bottles/frontend/widgets/library.py +++ b/bottles/frontend/widgets/library.py @@ -17,7 +17,7 @@ from gettext import gettext as _ -from gi.repository import Gtk, GdkPixbuf +from gi.repository import Gtk, Gdk from bottles.backend.logger import Logger from bottles.backend.managers.library import LibraryManager @@ -75,6 +75,7 @@ def __init__(self, library, uuid, entry, *args, **kwargs): self.label_name.set_text(name) self.label_bottle.set_text(entry['bottle']['name']) + self.label_no_cover.set_label(self.name) if entry.get('thumbnail'): path = ThumbnailManager.get_path(self.config, entry['thumbnail']) @@ -88,9 +89,10 @@ def __init__(self, library, uuid, entry, *args, **kwargs): entry = library_manager.get_library().get(uuid) path = ThumbnailManager.get_path(self.config, entry['thumbnail']) - if path is not None: - pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(path, 240, 360) - self.img_cover.set_pixbuf(pixbuf) + if path is not None: + # Gtk.Picture.set_pixbuf deprecated in GTK 4.12 + texture = Gdk.Texture.new_from_filename(path) + self.img_cover.set_paintable(texture) self.img_cover.set_visible(True) self.label_no_cover.set_visible(False)