From f054d2a7c4fc2c1c078d02a7241c9b38eabbcce6 Mon Sep 17 00:00:00 2001 From: Jason Perlow Date: Sun, 25 Oct 2026 17:13:37 -0400 Subject: [PATCH] fix(about): keep the distro logo aspect ratio The About page drew the os-release LOGO icon as an Image with a 96 px pixel size, which squeezes a non-square logo into a square. Show logo artwork through a Picture with ContentFit.CONTAIN in a 96x96 box and keep the accent-coloured Image for the generic symbolic fallback. Assisted-by: Claude Code:claude-opus-5-5 AI-Scope: replaced the About page logo Image with a contain-fit Picture for non-symbolic logos in system_page.vala. --- src/components/sidebar/pages/system_page.vala | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/sidebar/pages/system_page.vala b/src/components/sidebar/pages/system_page.vala index 514b1b1..615ed89 100644 --- a/src/components/sidebar/pages/system_page.vala +++ b/src/components/sidebar/pages/system_page.vala @@ -38,11 +38,7 @@ namespace Singularity.SidebarPages { logo_box.margin_top = 12; logo_box.margin_bottom = 4; logo_box.halign = Align.CENTER; - var logo = new Image.from_icon_name("computer-symbolic"); - logo.icon_name = get_distro_icon_name(); - logo.pixel_size = 96; - logo.add_css_class("accent-color"); - logo_box.append(logo); + logo_box.append(build_distro_logo(96)); add_widget(logo_box); var device_group = new PreferencesGroup(); hostname_row = new EntryRow(_("Device Name")); @@ -239,6 +235,26 @@ namespace Singularity.SidebarPages { } } + private Widget build_distro_logo(int size) { + var icon_name = get_distro_icon_name(); + var display = Gdk.Display.get_default(); + if (icon_name == "computer-symbolic" || display == null) { + var image = new Image.from_icon_name(icon_name); + image.pixel_size = size; + image.add_css_class("accent-color"); + return image; + } + var paintable = Gtk.IconTheme.get_for_display(display).lookup_icon( + icon_name, null, size, 2, TextDirection.NONE, 0); + var picture = new Picture.for_paintable(paintable); + picture.content_fit = ContentFit.CONTAIN; + picture.can_shrink = true; + picture.set_size_request(size, size); + picture.halign = Align.CENTER; + picture.valign = Align.CENTER; + return picture; + } + private string get_distro_icon_name() { string? logo_icon = HardwareInfo.os_release("LOGO"); string? distro_id = HardwareInfo.os_release("ID");