From 0958200f461f3698a58d15fee07f3fb042f522c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 29 Jan 2026 09:16:42 -0800 Subject: [PATCH] AppChooser/Dialog: handle links --- src/AppChooser/Dialog.vala | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/AppChooser/Dialog.vala b/src/AppChooser/Dialog.vala index 4c417211..4614ffe3 100644 --- a/src/AppChooser/Dialog.vala +++ b/src/AppChooser/Dialog.vala @@ -48,16 +48,24 @@ public class AppChooser.Dialog : Gtk.Window { buttons = new HashTable (str_hash, str_equal); AppInfo? info = app_id == "" ? null : new DesktopAppInfo (app_id + ".desktop"); - var primary_text = _("Open file with…"); + var primary_text = _("Open with…"); if (filename != "") { primary_text = _("Open “%s” with…").printf (filename); } var content_description = ContentType.get_description ("text/plain"); - var content_icon = ContentType.get_icon ("text/plain"); + Icon secondary_icon = new ThemedIcon ("document-open"); if (content_type != "") { content_description = ContentType.get_description (content_type); - content_icon = ContentType.get_icon (content_type); + if (content_description.contains ("x-scheme-handler")) { + ///TRANSLATORS: An http link + content_description = _("link"); + } + + var content_icon = ContentType.get_icon (content_type); + if (Gtk.IconTheme.get_for_display (Gdk.Display.get_default ()).has_gicon (content_icon)) { + secondary_icon = content_icon; + } } var primary_label = new Gtk.Label (primary_text) { @@ -82,7 +90,7 @@ public class AppChooser.Dialog : Gtk.Window { xalign = 0 }; - var mime_icon = new Gtk.Image.from_gicon (content_icon) { + var mime_icon = new Gtk.Image.from_gicon (secondary_icon) { pixel_size = 48 };