[balsa/wip/gtk4: 63/351] The logo in the "about" dialog is now a GdkTexture



commit cc32fc948828eb10e307242e6f5bade89171a7fc
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Nov 9 16:20:08 2017 -0500

    The logo in the "about" dialog is now a GdkTexture

 src/main-window.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/main-window.c b/src/main-window.c
index 359dbde..8d71f90 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -963,10 +963,23 @@ about_activated(GSimpleAction * action,
     };
 
     const gchar *translator_credits = _("translator-credits");
-    /* FIXME: do we need error handling for this? */
-    GdkPixbuf *balsa_logo =
-        gdk_pixbuf_new_from_file(BALSA_DATA_PREFIX
-                                 "/pixmaps/balsa_logo.png", NULL);
+    gchar *logo_path;
+    GFile *logo_file;
+    GdkTexture *balsa_logo;
+    GError *err = NULL;
+
+    logo_path = g_build_filename(BALSA_DATA_PREFIX, "pixmaps", "balsa_logo.png", NULL);
+    logo_file = g_file_new_for_path(logo_path);
+
+    balsa_logo = gdk_texture_new_from_file(logo_file, &err);
+    g_object_unref(logo_file);
+
+    if (err) {
+        balsa_information(LIBBALSA_INFORMATION_WARNING,
+                          _("Error loading %s: %s\n"), logo_path, err->message);
+        g_error_free(err);
+    }
+    g_free(logo_path);
 
     gtk_show_about_dialog(window,
                           "version", BALSA_VERSION,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]