Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library changes & Quit fix #2906

Merged
merged 22 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bottles/frontend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions bottles/frontend/ui/library-entry.blp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ template LibraryEntry : Box {
vexpand: true;
label: _("No Thumbnail");

wrap: true;
wrap-mode: word_char;

styles [
"dim-label",
]
Expand Down
10 changes: 6 additions & 4 deletions bottles/frontend/widgets/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'])
Expand All @@ -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)

Expand Down