about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Hill <dhill@conformal.com>2013-05-13 20:08:07 -0400
committerDavid Hill <dhill@conformal.com>2013-05-13 20:08:07 -0400
commit8ee0733bee1974a35073801f32753604e4c0ac79 (patch)
treefadde70ecc50378e1d265809d5a7d8627a7574d4
parentee114622ce724ea97664c2cf5b7e1cbf54621b1f (diff)
downloadxombrero-8ee0733bee1974a35073801f32753604e4c0ac79.tar.gz
gtk_widget_modify_font is deprecated. Use gtk_widget_override_font if using gtk 3.0.
-rw-r--r--settings.c16
-rw-r--r--xombrero.c10
-rw-r--r--xombrero.h6
3 files changed, 19 insertions, 13 deletions
diff --git a/settings.c b/settings.c
index 98fd74c..5438672 100644
--- a/settings.c
+++ b/settings.c
@@ -734,7 +734,7 @@ set_cmd_font(char *value)
 		cmd_font_name = g_strdup(value);
 	cmd_font = pango_font_description_from_string(cmd_font_name);
 	TAILQ_FOREACH(t, &tabs, entry)
-		gtk_widget_modify_font(GTK_WIDGET(t->cmd), cmd_font);
+		modify_font(GTK_WIDGET(t->cmd), cmd_font);
 	return (0);
 }
 
@@ -760,7 +760,7 @@ set_oops_font(char *value)
 		oops_font_name = g_strdup(value);
 	oops_font = pango_font_description_from_string(oops_font_name);
 	TAILQ_FOREACH(t, &tabs, entry)
-		gtk_widget_modify_font(GTK_WIDGET(t->oops), oops_font);
+		modify_font(GTK_WIDGET(t->oops), oops_font);
 	return (0);
 }
 
@@ -795,15 +795,15 @@ set_statusbar_font(char *value)
 	statusbar_font = pango_font_description_from_string(
 	    statusbar_font_name);
 	TAILQ_FOREACH(t, &tabs, entry) {
-		gtk_widget_modify_font(GTK_WIDGET(t->sbe.uri),
+		modify_font(GTK_WIDGET(t->sbe.uri),
 		    statusbar_font);
-		gtk_widget_modify_font(GTK_WIDGET(t->sbe.buffercmd),
+		modify_font(GTK_WIDGET(t->sbe.buffercmd),
 		    statusbar_font);
-		gtk_widget_modify_font(GTK_WIDGET(t->sbe.zoom),
+		modify_font(GTK_WIDGET(t->sbe.zoom),
 		    statusbar_font);
-		gtk_widget_modify_font(GTK_WIDGET(t->sbe.position),
+		modify_font(GTK_WIDGET(t->sbe.position),
 		    statusbar_font);
-		gtk_widget_modify_font(GTK_WIDGET(t->sbe.proxy),
+		modify_font(GTK_WIDGET(t->sbe.proxy),
 		    statusbar_font);
 	}
 	return (0);
@@ -831,7 +831,7 @@ set_tabbar_font(char *value)
 		tabbar_font_name = g_strdup(value);
 	tabbar_font = pango_font_description_from_string(tabbar_font_name);
 	TAILQ_FOREACH(t, &tabs, entry)
-		gtk_widget_modify_font(GTK_WIDGET(t->tab_elems.label),
+		modify_font(GTK_WIDGET(t->tab_elems.label),
 		    tabbar_font);
 	return (0);
 }
diff --git a/xombrero.c b/xombrero.c
index 15670ea..def6fef 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -7374,7 +7374,7 @@ create_sbe(void)
 
 	sbe = gtk_label_new(NULL);
 	gtk_widget_set_can_focus(GTK_WIDGET(sbe), FALSE);
-	gtk_widget_modify_font(GTK_WIDGET(sbe), statusbar_font);
+	modify_font(GTK_WIDGET(sbe), statusbar_font);
 	return (sbe);
 }
 
@@ -7436,7 +7436,7 @@ statusbar_create(struct tab *t)
 	/* create these widgets only if specified in statusbar_elems */
 	t->sbe.uri = gtk_entry_new();
 	gtk_widget_set_can_focus(GTK_WIDGET(t->sbe.uri), FALSE);
-	gtk_widget_modify_font(GTK_WIDGET(t->sbe.uri), statusbar_font);
+	modify_font(GTK_WIDGET(t->sbe.uri), statusbar_font);
 #if !GTK_CHECK_VERSION(3, 0, 0)
 	gtk_entry_set_inner_border(GTK_ENTRY(t->sbe.uri), NULL);
 	gtk_entry_set_has_frame(GTK_ENTRY(t->sbe.uri), FALSE);
@@ -7617,7 +7617,7 @@ create_new_tab(char *title, struct undo *u, int focus, int position)
 	gtk_widget_modify_base(t->oops, GTK_STATE_NORMAL, &color);
 #endif
 	gtk_box_pack_end(GTK_BOX(t->vbox), t->oops, FALSE, FALSE, 0);
-	gtk_widget_modify_font(GTK_WIDGET(t->oops), oops_font);
+	modify_font(GTK_WIDGET(t->oops), oops_font);
 
 	/* command entry */
 	t->cmd = gtk_entry_new();
@@ -7626,7 +7626,7 @@ create_new_tab(char *title, struct undo *u, int focus, int position)
 	gtk_entry_set_inner_border(GTK_ENTRY(t->cmd), NULL);
 	gtk_entry_set_has_frame(GTK_ENTRY(t->cmd), FALSE);
 	gtk_box_pack_end(GTK_BOX(t->vbox), t->cmd, FALSE, FALSE, 0);
-	gtk_widget_modify_font(GTK_WIDGET(t->cmd), cmd_font);
+	modify_font(GTK_WIDGET(t->cmd), cmd_font);
 
 	/* status bar */
 	statusbar_create(t);
@@ -7676,7 +7676,7 @@ create_new_tab(char *title, struct undo *u, int focus, int position)
 	gtk_label_set_width_chars(GTK_LABEL(t->tab_elems.label), 1);
 	gtk_misc_set_alignment(GTK_MISC(t->tab_elems.label), 0.0, 0.0);
 	gtk_misc_set_padding(GTK_MISC(t->tab_elems.label), 4.0, 4.0);
-	gtk_widget_modify_font(GTK_WIDGET(t->tab_elems.label), tabbar_font);
+	modify_font(GTK_WIDGET(t->tab_elems.label), tabbar_font);
 
 	gdk_color_parse(XT_COLOR_CT_BACKGROUND, &color);
 	gtk_widget_modify_bg(t->tab_elems.eventbox, GTK_STATE_NORMAL, &color);
diff --git a/xombrero.h b/xombrero.h
index 381ed95..7a9ab50 100644
--- a/xombrero.h
+++ b/xombrero.h
@@ -855,6 +855,12 @@ int		set_scrollbar_visibility(struct tab *, int);
 int		save_runtime_setting(const char *, const char *);
 void		wl_add(const char *, struct wl_list *, int);
 
+#if GTK_CHECK_VERSION(3,0,0)
+#define modify_font gtk_widget_override_font
+#else
+#define modify_font gtk_widget_modify_font
+#endif
+
 #define		XT_DL_START	(0)
 #define		XT_DL_RESTART	(1)
 int		download_start(struct tab *, struct download *, int flag);