mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Merge pull request #1153 from mitchellh/gtk-icons
apprt/gtk: correct icon path now that our resources dir is in a subdir
This commit is contained in:
@ -29,12 +29,22 @@ pub fn appIcon(app: *App, widget: *c.GtkWidget) !Icon {
|
|||||||
// to the search path and see if we can find it there.
|
// to the search path and see if we can find it there.
|
||||||
const icon_theme = c.gtk_icon_theme_get_for_display(c.gtk_widget_get_display(widget));
|
const icon_theme = c.gtk_icon_theme_get_for_display(c.gtk_widget_get_display(widget));
|
||||||
if (c.gtk_icon_theme_has_icon(icon_theme, icon_name) == 0) icon: {
|
if (c.gtk_icon_theme_has_icon(icon_theme, icon_name) == 0) icon: {
|
||||||
const base = global_state.resources_dir orelse {
|
const resources_dir = global_state.resources_dir orelse {
|
||||||
log.info("gtk app missing Ghostty icon and no resources dir detected", .{});
|
log.info("gtk app missing Ghostty icon and no resources dir detected", .{});
|
||||||
log.info("gtk app will not have Ghostty icon", .{});
|
log.info("gtk app will not have Ghostty icon", .{});
|
||||||
break :icon;
|
break :icon;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// The resources dir usually is `/usr/share/ghostty` but GTK icons
|
||||||
|
// go into `/usr/share/icons`.
|
||||||
|
const base = std.fs.path.dirname(resources_dir) orelse {
|
||||||
|
log.warn(
|
||||||
|
"unexpected error getting dirname of resources dir dir={s}",
|
||||||
|
.{resources_dir},
|
||||||
|
);
|
||||||
|
break :icon;
|
||||||
|
};
|
||||||
|
|
||||||
// Note that this method for adding the icon search path is
|
// Note that this method for adding the icon search path is
|
||||||
// a fallback mechanism. The recommended mechanism is the
|
// a fallback mechanism. The recommended mechanism is the
|
||||||
// Freedesktop Icon Theme Specification. We distribute a ".desktop"
|
// Freedesktop Icon Theme Specification. We distribute a ".desktop"
|
||||||
|
Reference in New Issue
Block a user