Save games in higher resolution - closes #7

This commit is contained in:
kramo
2023-03-13 20:53:07 +01:00
parent 0ee20a1a1f
commit 592a2d4829
4 changed files with 36 additions and 29 deletions

View File

@@ -6,28 +6,27 @@ template game : Box {
halign: center;
valign: start;
Button cover_button {
Picture cover {
width-request: 200;
height-request: 300;
hexpand: true;
vexpand: true;
styles [
"card",
]
}
styles [
"card",
"flat",
]
}
Adw.Clamp {
maximum-size: 200;
Box {
orientation: vertical;
Button cover_button {
Picture cover {
width-request: 200;
height-request: 300;
hexpand: true;
vexpand: true;
styles [
"card",
]
}
styles [
"card",
"flat",
]
}
Overlay overlay {
[overlay]
Revealer play_revealer {

View File

@@ -67,15 +67,18 @@ template CartridgesWindow : Adw.ApplicationWindow {
margin-top: 24;
margin-bottom: 24;
Picture overview_cover {
halign: end;
valign: start;
width-request: 200;
height-request: 300;
Adw.Clamp {
maximum-size: 200;
Picture overview_cover {
halign: end;
valign: start;
width-request: 200;
height-request: 300;
styles [
"card",
]
styles [
"card",
]
}
}
Box {

View File

@@ -75,8 +75,13 @@ def create_details_window(parent_widget, game_id = None):
)
cover_overlay.add_overlay(cover_button)
cover_clamp = Adw.Clamp(
maximum_size = 200,
child = cover_overlay,
)
cover_group = Adw.PreferencesGroup()
cover_group.add(cover_overlay)
cover_group.add(cover_clamp)
title_group = Adw.PreferencesGroup(
title = _("Title"),

View File

@@ -31,7 +31,7 @@ def save_cover(game, parent_widget, file_path, pixbuf = None, game_id = None):
cover_path = os.path.join(covers_dir, game_id + ".dat")
if pixbuf == None:
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(file_path, 200, 300, False)
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(file_path, 600, 900, False)
open_file = open((cover_path), "wb")
open_file.write(bytes(pixbuf.get_pixels()))