From c0e27bd0da9c6804c788473b891bff6c0c98af66 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 18 Aug 2019 14:41:31 +0100 Subject: access gtk throbber frames through an interface This changes the gtk throbber frames to be accessed through an API This removes teh nsgtk_throbber global and hides the implementation details from the rest of the code. --- frontends/gtk/toolbar.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'frontends/gtk/toolbar.c') diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c index d1b129afd..4ca03a1ea 100644 --- a/frontends/gtk/toolbar.c +++ b/frontends/gtk/toolbar.c @@ -478,23 +478,23 @@ nsgtk_toolbar_make_widget(struct nsgtk_scaffolding *g, } case THROBBER_ITEM: { - if ((nsgtk_throbber == NULL) || - (nsgtk_throbber->framedata == NULL) || - (nsgtk_throbber->framedata[0] == NULL)) { + nserror res; + GdkPixbuf *pixbuf; + res = nsgtk_throbber_get_frame(0, &pixbuf); + if (res != NSERROR_OK) { return NULL; } if (edit_mode) { - w = GTK_WIDGET(gtk_tool_button_new(GTK_WIDGET( - gtk_image_new_from_pixbuf( - nsgtk_throbber->framedata[0])), - "[throbber]")); + w = GTK_WIDGET(gtk_tool_button_new( + GTK_WIDGET(gtk_image_new_from_pixbuf(pixbuf)), + "[throbber]")); } else { GtkWidget *image; w = GTK_WIDGET(gtk_tool_item_new()); - image = gtk_image_new_from_pixbuf(nsgtk_throbber->framedata[0]); + image = gtk_image_new_from_pixbuf(pixbuf); if (image != NULL) { nsgtk_widget_set_alignment(image, GTK_ALIGN_CENTER, -- cgit v1.2.3