From f0450bb4001a9d37025578b7933b552cb07b27f6 Mon Sep 17 00:00:00 2001 From: monsta Date: Fri, 15 Jan 2016 13:54:23 +0300 Subject: libslab: use GtkBox instead of GtkVBox in both GTK+ builds and fix deprecated usage of GtkHBox and GtkVBox in GTK+3 build NOTE: this commit changes the public interface of libslab in both GTK+ builds (due to transition of classes' parents and/or members from GtkVBox to GtkBox) --- libslab/slab-section.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libslab/slab-section.c') diff --git a/libslab/slab-section.c b/libslab/slab-section.c index c03f0c94..d7dd978c 100644 --- a/libslab/slab-section.c +++ b/libslab/slab-section.c @@ -20,7 +20,7 @@ #include "slab-section.h" -G_DEFINE_TYPE (SlabSection, slab_section, GTK_TYPE_VBOX) +G_DEFINE_TYPE (SlabSection, slab_section, GTK_TYPE_BOX) static void slab_section_finalize (GObject *); @@ -123,6 +123,7 @@ slab_section_new_with_markup (const gchar * title_markup, SlabStyle style) gchar * widget_theming_name; section = g_object_new (SLAB_SECTION_TYPE, NULL); + gtk_orientable_set_orientation (GTK_ORIENTABLE (section), GTK_ORIENTATION_VERTICAL); gtk_box_set_homogeneous (GTK_BOX (section), FALSE); gtk_box_set_spacing (GTK_BOX (section), 0); section->style = style; @@ -145,7 +146,11 @@ slab_section_new_with_markup (const gchar * title_markup, SlabStyle style) } gtk_box_pack_start (GTK_BOX (section), align, TRUE, TRUE, 0); +#if GTK_CHECK_VERSION (3, 0, 0) + section->childbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 10)); +#else section->childbox = GTK_BOX (gtk_vbox_new (FALSE, 10)); +#endif gtk_container_add (GTK_CONTAINER (align), GTK_WIDGET (section->childbox)); section->title = gtk_label_new (title_markup); -- cgit v1.2.1