From cf39567d3b05b69383c252812c5adf26382c866a Mon Sep 17 00:00:00 2001 From: Wolfgang Ulbrich Date: Mon, 18 Jan 2016 15:41:50 +0100 Subject: GTK3: fix deprecated GTK_TYPE_{H/V}BOX usage --- src/caja-emblem-sidebar.c | 8 +++++++- src/caja-sidebar-title.c | 8 ++++++++ src/caja-trash-bar.c | 7 +++++++ src/caja-x-content-bar.c | 7 ++++++- src/caja-zoom-control.c | 11 +++++++++++ 5 files changed, 39 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/caja-emblem-sidebar.c b/src/caja-emblem-sidebar.c index c3740524..75e9f61f 100644 --- a/src/caja-emblem-sidebar.c +++ b/src/caja-emblem-sidebar.c @@ -111,8 +111,11 @@ typedef struct GObjectClass parent; } CajaEmblemSidebarProviderClass; - +#if GTK_CHECK_VERSION (3, 0, 0) +G_DEFINE_TYPE_WITH_CODE (CajaEmblemSidebar, caja_emblem_sidebar, GTK_TYPE_BOX, +#else G_DEFINE_TYPE_WITH_CODE (CajaEmblemSidebar, caja_emblem_sidebar, GTK_TYPE_VBOX, +#endif G_IMPLEMENT_INTERFACE (CAJA_TYPE_SIDEBAR, caja_emblem_sidebar_iface_init)); @@ -1044,6 +1047,9 @@ caja_emblem_sidebar_init (CajaEmblemSidebar *emblem_sidebar) "emblems_changed", G_CALLBACK (emblems_changed_callback), emblem_sidebar, 0); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_orientable_set_orientation (GTK_ORIENTABLE (emblem_sidebar), GTK_ORIENTATION_VERTICAL); +#endif gtk_box_pack_start (GTK_BOX (emblem_sidebar), widget, TRUE, TRUE, 0); } diff --git a/src/caja-sidebar-title.c b/src/caja-sidebar-title.c index ec8ef777..e5905051 100644 --- a/src/caja-sidebar-title.c +++ b/src/caja-sidebar-title.c @@ -111,7 +111,11 @@ struct CajaSidebarTitleDetails gboolean determined_icon; }; +#if GTK_CHECK_VERSION (3, 0, 0) +G_DEFINE_TYPE (CajaSidebarTitle, caja_sidebar_title, GTK_TYPE_BOX) +#else G_DEFINE_TYPE (CajaSidebarTitle, caja_sidebar_title, GTK_TYPE_VBOX) +#endif static void @@ -150,6 +154,10 @@ caja_sidebar_title_init (CajaSidebarTitle *sidebar_title) CAJA_TYPE_SIDEBAR_TITLE, CajaSidebarTitleDetails); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_orientable_set_orientation (GTK_ORIENTABLE (sidebar_title), GTK_ORIENTATION_VERTICAL); +#endif + /* Create the icon */ sidebar_title->details->icon = gtk_image_new (); gtk_box_pack_start (GTK_BOX (sidebar_title), sidebar_title->details->icon, 0, 0, 0); diff --git a/src/caja-trash-bar.c b/src/caja-trash-bar.c index 186c8527..25630612 100644 --- a/src/caja-trash-bar.c +++ b/src/caja-trash-bar.c @@ -51,7 +51,11 @@ struct CajaTrashBarPrivate gulong selection_handler_id; }; +#if GTK_CHECK_VERSION (3, 0, 0) +G_DEFINE_TYPE (CajaTrashBar, caja_trash_bar, GTK_TYPE_BOX); +#else G_DEFINE_TYPE (CajaTrashBar, caja_trash_bar, GTK_TYPE_HBOX); +#endif static void restore_button_clicked_cb (GtkWidget *button, @@ -189,6 +193,9 @@ caja_trash_bar_init (CajaTrashBar *bar) label = gtk_label_new (_("Trash")); gtk_widget_show (label); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_orientable_set_orientation (GTK_ORIENTABLE (bar), GTK_ORIENTATION_HORIZONTAL); +#endif gtk_box_pack_start (GTK_BOX (bar), label, FALSE, FALSE, 0); bar->priv->empty_button = gtk_button_new_with_mnemonic (_("Empty _Trash")); diff --git a/src/caja-x-content-bar.c b/src/caja-x-content-bar.c index 19fcf135..1ef5fcba 100644 --- a/src/caja-x-content-bar.c +++ b/src/caja-x-content-bar.c @@ -50,7 +50,11 @@ enum PROP_X_CONTENT_TYPE, }; +#if GTK_CHECK_VERSION (3, 0, 0) +G_DEFINE_TYPE (CajaXContentBar, caja_x_content_bar, GTK_TYPE_BOX) +#else G_DEFINE_TYPE (CajaXContentBar, caja_x_content_bar, GTK_TYPE_HBOX) +#endif void caja_x_content_bar_set_x_content_type (CajaXContentBar *bar, const char *x_content_type) @@ -304,7 +308,8 @@ caja_x_content_bar_init (CajaXContentBar *bar) bar->priv->label = gtk_label_new (NULL); gtk_label_set_ellipsize (GTK_LABEL (bar->priv->label), PANGO_ELLIPSIZE_END); -#if GTK_CHECK_VERSION (3, 14, 0) +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_orientable_set_orientation (GTK_ORIENTABLE (bar), GTK_ORIENTATION_HORIZONTAL); gtk_widget_set_halign (bar->priv->label, GTK_ALIGN_START); #else gtk_misc_set_alignment (GTK_MISC (bar->priv->label), 0.0, 0.5); diff --git a/src/caja-zoom-control.c b/src/caja-zoom-control.c index 2fe7b5a5..fb8ba0da 100644 --- a/src/caja-zoom-control.c +++ b/src/caja-zoom-control.c @@ -110,7 +110,11 @@ static GType caja_zoom_control_accessible_get_type (void); #define NUM_ACTIONS ((int)G_N_ELEMENTS (caja_zoom_control_accessible_action_names)) +#if GTK_CHECK_VERSION (3, 0, 0) +G_DEFINE_TYPE (CajaZoomControl, caja_zoom_control, GTK_TYPE_BOX); +#else G_DEFINE_TYPE (CajaZoomControl, caja_zoom_control, GTK_TYPE_HBOX); +#endif static void caja_zoom_control_finalize (GObject *object) @@ -322,6 +326,9 @@ caja_zoom_control_init (CajaZoomControl *zoom_control) g_signal_connect (G_OBJECT (zoom_control->details->zoom_out), "clicked", G_CALLBACK (zoom_out_clicked), zoom_control); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_orientable_set_orientation (GTK_ORIENTABLE (zoom_control), GTK_ORIENTATION_HORIZONTAL); +#endif gtk_container_add (GTK_CONTAINER (zoom_control->details->zoom_out), image); gtk_box_pack_start (GTK_BOX (zoom_control), zoom_control->details->zoom_out, FALSE, FALSE, 0); @@ -978,7 +985,11 @@ caja_zoom_control_accessible_get_type (void) type = eel_accessibility_create_derived_type ("CajaZoomControlAccessible", +#if GTK_CHECK_VERSION (3, 0, 0) + GTK_TYPE_BOX, +#else GTK_TYPE_HBOX, +#endif caja_zoom_control_accessible_class_init); g_type_add_interface_static (type, ATK_TYPE_ACTION, -- cgit v1.2.1