From b7d26a3ac3071206e226003a23b21d551b9478ed Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Thu, 12 Sep 2024 23:34:34 +0100 Subject: [PATCH] apprt/gtk: use AdwAboutDialog if available Matches the libadwaita theme and UX. Signed-off-by: Tristan Partin --- src/apprt/gtk/Window.zig | 51 +++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/src/apprt/gtk/Window.zig b/src/apprt/gtk/Window.zig index c3df9b33d..265fb40b7 100644 --- a/src/apprt/gtk/Window.zig +++ b/src/apprt/gtk/Window.zig @@ -456,20 +456,43 @@ fn gtkActionAbout( ) callconv(.C) void { const self: *Window = @ptrCast(@alignCast(ud orelse return)); - c.gtk_show_about_dialog( - self.window, - "program-name", - "Ghostty", - "logo-icon-name", - "com.mitchellh.ghostty", - "title", - "About Ghostty", - "version", - build_config.version_string.ptr, - "website", - "https://github.com/ghostty-org/ghostty", - @as(?*anyopaque, null), - ); + const name = "Ghostty"; + const icon = "com.mitchellh.ghostty"; + const website = "https://github.com/ghostty-org/ghostty"; + + if (self.isAdwWindow()) { + c.adw_show_about_dialog( + @ptrCast(self.window), + "application-name", + name, + "developer-name", + "Ghostty Developers", + "application-icon", + icon, + "version", + build_config.version_string.ptr, + "issue-url", + "https://github.com/ghostty-org/ghostty/issues", + "website", + website, + @as(?*anyopaque, null), + ); + } else { + c.gtk_show_about_dialog( + self.window, + "program-name", + name, + "logo-icon-name", + icon, + "title", + "About Ghostty", + "version", + build_config.version_string.ptr, + "website", + website, + @as(?*anyopaque, null), + ); + } } fn gtkActionClose(