Skip to content

Commit c2fd0de

Browse files
committed
Improve size of icons in headerbar
1 parent f5bd168 commit c2fd0de

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

biglinux-livecd/usr/share/biglinux/livecd/assets/headerbar-locale.svg

Lines changed: 1 addition & 1 deletion
Loading

biglinux-livecd/usr/share/biglinux/livecd/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
transform: scale(1.0);
1717
}
1818
}
19+
20+
.step-pending, .step-current, .step-completed {
21+
transform: scale(0.5);
22+
}
23+
1924
.app-content {
2025
background-color: @view_bg_color;
2126
}

biglinux-livecd/usr/share/biglinux/livecd/ui/app_window.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@ def get_comm_logo_path(system_service: SystemService = None):
4949
return DEFAULT_COMM_LOGO_PATH
5050

5151

52-
def load_svg_pixbuf(path, size):
52+
def load_svg_texture(path, size):
53+
"""Load SVG as Gdk.Texture for better GTK4 scaling."""
5354
try:
54-
return GdkPixbuf.Pixbuf.new_from_file_at_size(path, size, size)
55+
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(path, size, size)
56+
return Gdk.Texture.new_for_pixbuf(pixbuf)
5557
except GLib.Error as e:
5658
logger.error(f"Failed to load SVG {path}: {e}")
57-
return GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, size, size)
59+
# Create a fallback empty pixbuf and convert to texture
60+
pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, size, size)
61+
return Gdk.Texture.new_for_pixbuf(pixbuf)
5862

5963

6064
class AppWindow(Adw.ApplicationWindow):
@@ -234,10 +238,11 @@ def _add_step_button(self, box, step_info):
234238
button = Gtk.Button()
235239
button.set_focusable(False)
236240
path = os.path.join(ASSETS_DIR, step_info["file"])
237-
pixbuf = load_svg_pixbuf(path, 32)
238-
img = Gtk.Image.new_from_pixbuf(pixbuf)
241+
texture = load_svg_texture(path, 48)
242+
img = Gtk.Image.new_from_paintable(texture)
243+
img.set_pixel_size(64)
239244
button.set_child(img)
240-
button.set_size_request(48, 48)
245+
button.set_size_request(64, 64)
241246
button.connect("clicked", self._on_step_button_clicked, step_info["name"])
242247
button.add_css_class("flat")
243248

@@ -327,8 +332,9 @@ def _on_language_selected(self, view, selection):
327332
if os.path.exists(candidate)
328333
else os.path.join(ASSETS_DIR, "headerbar-locale.svg")
329334
)
330-
pixbuf = load_svg_pixbuf(path, 32)
331-
img.set_from_pixbuf(pixbuf)
335+
texture = load_svg_texture(path, 48)
336+
img.set_from_paintable(texture)
337+
img.set_pixel_size(48)
332338

333339
keyboard_layout = params.get("keyboard", "us")
334340

0 commit comments

Comments
 (0)