summaryrefslogtreecommitdiff
path: root/gtk/compat.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-04-11 18:41:00 +0100
committerVincent Sanders <vince@kyllikki.org>2015-04-11 18:41:00 +0100
commit5e51600cfe713fa320734291ec15a7a584c1c25b (patch)
tree79a1764a55a181b2dc92da3f651c1557b0716c59 /gtk/compat.c
parentdf4e9e322dc8c64af1fc8aabc26c8d4ddab32574 (diff)
downloadnetsurf-5e51600cfe713fa320734291ec15a7a584c1c25b.tar.gz
netsurf-5e51600cfe713fa320734291ec15a7a584c1c25b.tar.bz2
Add gtk compatability for margin setting.
Diffstat (limited to 'gtk/compat.c')
-rw-r--r--gtk/compat.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/compat.c b/gtk/compat.c
index 8484c02fd..0717f5260 100644
--- a/gtk/compat.c
+++ b/gtk/compat.c
@@ -583,3 +583,16 @@ void nsgtk_widget_set_alignment(GtkWidget *widget, GtkAlign halign, GtkAlign val
gtk_misc_set_alignment(GTK_MISC(widget), x, y);
#endif
}
+
+/* exported interface documented in gtk/compat.h */
+void nsgtk_widget_set_margins(GtkWidget *widget, gint hmargin, gint vmargin)
+{
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_margin_left(widget, hmargin);
+ gtk_widget_set_margin_right(widget, hmargin);
+ gtk_widget_set_margin_top(widget, vmargin);
+ gtk_widget_set_margin_bottom(widget, vmargin);
+#else
+ gtk_misc_set_padding(GTK_MISC(widget), hmargin, vmargin);
+#endif
+}