diff options
author | Wolfgang Ulbrich <[email protected]> | 2016-01-17 21:45:22 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2016-01-17 21:45:22 +0100 |
commit | 57c2e8090698e8d05beec0c53e3a116fd8b88862 (patch) | |
tree | 51b24fec5c03202d7a16987c248d42f7f4c956d9 /src | |
parent | 312f33c5b54c735d15e78c9b96672b8b555f4834 (diff) | |
download | caja-57c2e8090698e8d05beec0c53e3a116fd8b88862.tar.bz2 caja-57c2e8090698e8d05beec0c53e3a116fd8b88862.tar.xz |
GTK3: more deprecated GtkVBox/GtkHBox fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/caja-image-properties-page.c | 8 | ||||
-rw-r--r-- | src/caja-image-properties-page.h | 8 | ||||
-rw-r--r-- | src/caja-window-slot.c | 9 | ||||
-rw-r--r-- | src/file-manager/fm-properties-window.c | 14 |
4 files changed, 37 insertions, 2 deletions
diff --git a/src/caja-image-properties-page.c b/src/caja-image-properties-page.c index b07d129c..c2faa25d 100644 --- a/src/caja-image-properties-page.c +++ b/src/caja-image-properties-page.c @@ -97,8 +97,11 @@ typedef struct static GType caja_image_properties_page_provider_get_type (void); static void property_page_provider_iface_init (CajaPropertyPageProviderIface *iface); - +#if GTK_CHECK_VERSION (3, 0, 0) +G_DEFINE_TYPE (CajaImagePropertiesPage, caja_image_properties_page, GTK_TYPE_BOX); +#else G_DEFINE_TYPE (CajaImagePropertiesPage, caja_image_properties_page, GTK_TYPE_VBOX); +#endif G_DEFINE_TYPE_WITH_CODE (CajaImagePropertiesPageProvider, caja_image_properties_page_provider, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (CAJA_TYPE_PROPERTY_PAGE_PROVIDER, @@ -655,6 +658,9 @@ caja_image_properties_page_init (CajaImagePropertiesPage *page) CAJA_TYPE_IMAGE_PROPERTIES_PAGE, CajaImagePropertiesPageDetails); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_orientable_set_orientation (GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL); +#endif gtk_box_set_homogeneous (GTK_BOX (page), FALSE); gtk_box_set_spacing (GTK_BOX (page), 2); gtk_container_set_border_width (GTK_CONTAINER (page), 6); diff --git a/src/caja-image-properties-page.h b/src/caja-image-properties-page.h index 70cde795..6e07bab8 100644 --- a/src/caja-image-properties-page.h +++ b/src/caja-image-properties-page.h @@ -42,13 +42,21 @@ typedef struct CajaImagePropertiesPageDetails CajaImagePropertiesPageDetails; typedef struct { +#if GTK_CHECK_VERSION (3, 0, 0) + GtkBox parent; +#else GtkVBox parent; +#endif CajaImagePropertiesPageDetails *details; } CajaImagePropertiesPage; typedef struct { +#if GTK_CHECK_VERSION (3, 0, 0) + GtkBoxClass parent; +#else GtkVBoxClass parent; +#endif } CajaImagePropertiesPageClass; GType caja_image_properties_page_get_type (void); diff --git a/src/caja-window-slot.c b/src/caja-window-slot.c index 128b52f7..51847293 100644 --- a/src/caja-window-slot.c +++ b/src/caja-window-slot.c @@ -33,6 +33,10 @@ #include <eel/eel-gtk-macros.h> #include <eel/eel-string.h> +#if GTK_CHECK_VERSION (3, 0, 0) +#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y) +#endif + static void caja_window_slot_init (CajaWindowSlot *slot); static void caja_window_slot_class_init (CajaWindowSlotClass *class); static void caja_window_slot_dispose (GObject *object); @@ -479,8 +483,13 @@ caja_window_slot_set_content_view_widget (CajaWindowSlot *slot, if (new_view != NULL) { widget = caja_view_get_widget (new_view); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_box_pack_start (GTK_BOX (slot->view_box), widget, + TRUE, TRUE, 0); +#else gtk_container_add (GTK_CONTAINER (slot->view_box), GTK_WIDGET (new_view)); +#endif gtk_widget_show (widget); diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 4f5d3bf0..f977555b 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -380,7 +380,11 @@ get_target_file (FMPropertiesWindow *window) } static void +#if GTK_CHECK_VERSION (3, 0, 0) +add_prompt (GtkWidget *vbox, const char *prompt_text, gboolean pack_at_start) +#else add_prompt (GtkVBox *vbox, const char *prompt_text, gboolean pack_at_start) +#endif { GtkWidget *prompt; @@ -396,7 +400,11 @@ add_prompt (GtkVBox *vbox, const char *prompt_text, gboolean pack_at_start) } static void +#if GTK_CHECK_VERSION (3, 0, 0) +add_prompt_and_separator (GtkWidget *vbox, const char *prompt_text) +#else add_prompt_and_separator (GtkVBox *vbox, const char *prompt_text) +#endif { GtkWidget *separator_line; @@ -5747,7 +5755,7 @@ create_permissions_page (FMPropertiesWindow *window) if (!all_can_set_permissions (file_list)) { add_prompt_and_separator ( - GTK_VBOX (vbox), + vbox, _("You are not the owner, so you cannot change these permissions.")); } @@ -5865,7 +5873,11 @@ create_permissions_page (FMPropertiesWindow *window) prompt_text = g_strdup (_("The permissions of the selected file could not be determined.")); } +#if GTK_CHECK_VERSION (3, 0, 0) + add_prompt (vbox, prompt_text, TRUE); +#else add_prompt (GTK_VBOX (vbox), prompt_text, TRUE); +#endif g_free (prompt_text); } } |