summaryrefslogtreecommitdiff
path: root/gtk/toolbar.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-04-10 00:06:48 +0100
committerVincent Sanders <vince@kyllikki.org>2015-04-10 00:06:48 +0100
commit50f68b11a4983341bd94f0946e2f05f1d89ca1c8 (patch)
treec11c14450f4c0160ee9d3c4e0599894318495134 /gtk/toolbar.c
parent23ae8ccf110f94019c745ebc4959c06b842a626d (diff)
downloadnetsurf-50f68b11a4983341bd94f0946e2f05f1d89ca1c8.tar.gz
netsurf-50f68b11a4983341bd94f0946e2f05f1d89ca1c8.tar.bz2
fixup default toolbar button creation for depricated GTK 3 operations
Diffstat (limited to 'gtk/toolbar.c')
-rw-r--r--gtk/toolbar.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/gtk/toolbar.c b/gtk/toolbar.c
index 132ab2d7d..dd542d7fa 100644
--- a/gtk/toolbar.c
+++ b/gtk/toolbar.c
@@ -684,19 +684,23 @@ GtkWidget *nsgtk_toolbar_make_widget(struct nsgtk_scaffolding *g,
switch(i) {
/* gtk_tool_button_new() accepts NULL args */
-#define MAKE_STOCKBUTTON(p, q) case p##_BUTTON: {\
- GtkStockItem item;\
- char *label = NULL;\
- gtk_stock_lookup(q, &item);\
- if (item.label != NULL)\
- label = remove_underscores(item.label, false);\
- GtkWidget *w = GTK_WIDGET(gtk_tool_button_new(GTK_WIDGET(\
- theme->image[p##_BUTTON]), label));\
- if (label != NULL) {\
- free(label);\
- label = NULL;\
- }\
- return w;\
+#define MAKE_STOCKBUTTON(p, q) \
+ case p##_BUTTON: { \
+ GtkStockItem item; \
+ GtkWidget *w; \
+ if (nsgtk_stock_lookup(q, &item) && \
+ (item.label != NULL)) { \
+ char *label = NULL; \
+ w = GTK_WIDGET(gtk_tool_button_new(GTK_WIDGET( \
+ theme->image[p##_BUTTON]), label)); \
+ label = remove_underscores(item.label, false); \
+ free(label); \
+ label = NULL; \
+ } else { \
+ w = GTK_WIDGET(gtk_tool_button_new(GTK_WIDGET( \
+ theme->image[p##_BUTTON]), q)); \
+ } \
+ return w; \
}
MAKE_STOCKBUTTON(HOME, NSGTK_STOCK_HOME)