summaryrefslogtreecommitdiff
path: root/gtk/gtkbuilder.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-02-06 10:28:12 +0100
committerAlexander Larsson <alexl@redhat.com>2020-02-06 17:47:56 +0100
commit6ff9f2198d5284f1597a64a4c7d53ef4205df078 (patch)
treea4ab0bfb4a6a37ff8632c8dba8e528778e646d53 /gtk/gtkbuilder.c
parent1c253f5dfae9af0aeba5da15ce7db27c11a68909 (diff)
downloadgtk+-6ff9f2198d5284f1597a64a4c7d53ef4205df078.tar.gz
GtkBuilder: Directly load the fallback missing image
No need for all this complexity with the icon theme, especially when its now a lot more work to get the texture back. We can just load the pixbuf.
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r--gtk/gtkbuilder.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 62e3e7ad7c..1702a37aa9 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -223,6 +223,8 @@
#include "gtkprivate.h"
#include "gtktypebuiltins.h"
#include "gtkicontheme.h"
+#include "gtkiconthemeprivate.h"
+#include "gdkpixbufutilsprivate.h"
static void gtk_builder_finalize (GObject *object);
static void gtk_builder_set_property (GObject *object,
@@ -2159,25 +2161,11 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
if (pixbuf == NULL)
{
- GtkIconTheme *theme;
- GtkIconPaintable *icon;
- GdkTexture *texture;
-
g_warning ("Could not load image '%s': %s",
string, tmp_error->message);
g_error_free (tmp_error);
- /* fall back to a missing image */
- /* FIXME: this should be using the correct display */
- theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
-
- icon = gtk_icon_theme_lookup_icon (theme, "image-missing", NULL, 16, 1,
- GTK_TEXT_DIR_NONE,
- 0);
- texture = gtk_icon_paintable_download_texture (icon);
- pixbuf = gdk_pixbuf_get_from_texture (texture);
- g_object_unref (icon);
- g_object_unref (texture);
+ pixbuf = _gdk_pixbuf_new_from_resource (IMAGE_MISSING_RESOURCE_PATH, "png", NULL);
}
if (pixbuf)