Commit ffae9a09 authored by Claudio Saavedra's avatar Claudio Saavedra

Use GtkOrientable interface instead of deprecated V/H widgets

Gtk[HV]Box, Gtk[HV]Separator, Gtk[HV]Paned are deprecated in GTK+ 3.2,
so let's use the GtkOrientable interface instead.

GtkBox is likely to dissapear soon too, so a migration to GtkGrid
might be necessary at some point.

https://bugzilla.gnome.org/show_bug.cgi?id=652201
parent 0f61b9bd
......@@ -90,7 +90,7 @@ struct _EphyEmbedPrivate
guint tab_message_id;
};
G_DEFINE_TYPE (EphyEmbed, ephy_embed, GTK_TYPE_VBOX)
G_DEFINE_TYPE (EphyEmbed, ephy_embed, GTK_TYPE_BOX)
static void
restore_zoom_level (EphyEmbed *embed,
......@@ -616,9 +616,12 @@ ephy_embed_init (EphyEmbed *embed)
{
embed->priv = EPHY_EMBED_GET_PRIVATE (embed);
gtk_orientable_set_orientation (GTK_ORIENTABLE (embed),
GTK_ORIENTATION_VERTICAL);
embed->priv->scrolled_window = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL));
embed->priv->paned = GTK_PANED (gtk_vpaned_new ());
embed->priv->top_widgets_vbox = GTK_BOX (gtk_vbox_new (FALSE, 0));
embed->priv->paned = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL));
embed->priv->top_widgets_vbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
embed->priv->seq_context_id = 1;
embed->priv->seq_message_id = 1;
embed->priv->tab_message_id = ephy_embed_statusbar_get_context_id (embed, EPHY_EMBED_STATUSBAR_TAB_MESSAGE_CONTEXT_DESCRIPTION);
......
......@@ -44,14 +44,14 @@ typedef struct _EphyEmbedPrivate EphyEmbedPrivate;
#define EPHY_EMBED_STATUSBAR_HELP_MESSAGE_CONTEXT_DESCRIPTION "help_message"
struct _EphyEmbed {
GtkVBox parent_instance;
GtkBox parent_instance;
/*< private >*/
EphyEmbedPrivate *priv;
};
struct _EphyEmbedClass {
GtkVBoxClass parent_class;
GtkBoxClass parent_class;
};
GType ephy_embed_get_type (void);
......
......@@ -745,7 +745,7 @@ request_decision_on_storing (StorePasswordData *store_data)
info_bar = gtk_info_bar_new ();
action_area = gtk_info_bar_get_action_area (GTK_INFO_BAR (info_bar));
button_box = gtk_hbutton_box_new ();
button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (action_area), button_box);
action_button = gtk_button_new_with_label (_("Not now"));
......@@ -1717,7 +1717,7 @@ geolocation_policy_decision_requested_cb (WebKitWebView *web_view,
/* Buttons */
action_area = gtk_info_bar_get_action_area (GTK_INFO_BAR (info_bar));
button_box = gtk_hbutton_box_new ();
button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (action_area), button_box);
/* Translators: Geolocation policy for a specific site. */
......
......@@ -84,7 +84,7 @@ struct _EggEditableToolbarPrivate
gchar *primary_name;
};
G_DEFINE_TYPE (EggEditableToolbar, egg_editable_toolbar, GTK_TYPE_VBOX);
G_DEFINE_TYPE (EggEditableToolbar, egg_editable_toolbar, GTK_TYPE_BOX);
static int
get_dock_position (EggEditableToolbar *etoolbar,
......@@ -1031,7 +1031,7 @@ create_dock (EggEditableToolbar *etoolbar)
{
GtkWidget *toolbar, *hbox;
hbox = gtk_hbox_new (0, FALSE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
toolbar = gtk_toolbar_new ();
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), TRUE);
......@@ -1385,6 +1385,8 @@ egg_editable_toolbar_init (EggEditableToolbar *etoolbar)
priv = etoolbar->priv = EGG_EDITABLE_TOOLBAR_GET_PRIVATE (etoolbar);
gtk_orientable_set_orientation (GTK_ORIENTABLE (etoolbar),
GTK_ORIENTATION_VERTICAL);
priv->save_hidden = TRUE;
g_signal_connect (etoolbar, "notify::visible",
......@@ -1827,7 +1829,7 @@ new_separator_pixbuf (void)
GtkWidget *separator;
GdkPixbuf *pixbuf;
separator = gtk_vseparator_new ();
separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
pixbuf = new_pixbuf_from_widget (separator);
return pixbuf;
}
......
......@@ -41,7 +41,7 @@ typedef struct _EggEditableToolbarClass EggEditableToolbarClass;
struct _EggEditableToolbar
{
GtkVBox parent_object;
GtkBox parent_object;
/*< private >*/
EggEditableToolbarPrivate *priv;
......@@ -49,7 +49,7 @@ struct _EggEditableToolbar
struct _EggEditableToolbarClass
{
GtkVBoxClass parent_class;
GtkBoxClass parent_class;
void (* action_request) (EggEditableToolbar *etoolbar,
const char *action_name);
......
......@@ -71,7 +71,7 @@ struct EggToolbarEditorPrivate
gulong sig_handlers[SIGNAL_HANDLER_LIST_SIZE];
};
G_DEFINE_TYPE (EggToolbarEditor, egg_toolbar_editor, GTK_TYPE_VBOX);
G_DEFINE_TYPE (EggToolbarEditor, egg_toolbar_editor, GTK_TYPE_BOX);
static gint
compare_items (gconstpointer a,
......@@ -456,7 +456,7 @@ editor_create_item (EggToolbarEditor *editor,
G_CALLBACK (drag_end_cb), NULL);
}
vbox = gtk_vbox_new (0, FALSE);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (vbox);
gtk_container_add (GTK_CONTAINER (event_box), vbox);
......@@ -547,7 +547,7 @@ append_table (GtkTable *table, GList *items, gint y, gint width)
if (y > 0)
{
item = gtk_hseparator_new ();
item = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
alignment = gtk_alignment_new (0.5, 0.5, 1.0, 0.0);
gtk_container_add (GTK_CONTAINER (alignment), item);
gtk_widget_show (alignment);
......@@ -667,6 +667,8 @@ egg_toolbar_editor_init (EggToolbarEditor *t)
{
t->priv = EGG_TOOLBAR_EDITOR_GET_PRIVATE (t);
gtk_orientable_set_orientation (GTK_ORIENTABLE (t),
GTK_ORIENTATION_VERTICAL);
t->priv->manager = NULL;
t->priv->actions_list = NULL;
......
......@@ -40,7 +40,7 @@ typedef struct EggToolbarEditorPrivate EggToolbarEditorPrivate;
struct EggToolbarEditor
{
GtkVBox parent_object;
GtkBox parent_object;
/*< private >*/
EggToolbarEditorPrivate *priv;
......@@ -48,7 +48,7 @@ struct EggToolbarEditor
struct EggToolbarEditorClass
{
GtkVBoxClass parent_class;
GtkBoxClass parent_class;
};
......
......@@ -33,7 +33,7 @@
#include <glib/gi18n.h>
#include <webkit/webkit.h>
G_DEFINE_TYPE (EphyDownloadWidget, ephy_download_widget, GTK_TYPE_HBOX)
G_DEFINE_TYPE (EphyDownloadWidget, ephy_download_widget, GTK_TYPE_BOX)
#define DOWNLOAD_WIDGET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), EPHY_TYPE_DOWNLOAD_WIDGET, EphyDownloadWidgetPrivate))
......@@ -399,6 +399,9 @@ static void
ephy_download_widget_init (EphyDownloadWidget *self)
{
self->priv = DOWNLOAD_WIDGET_PRIVATE (self);
gtk_orientable_set_orientation (GTK_ORIENTABLE (self),
GTK_ORIENTATION_HORIZONTAL);
}
/**
......
......@@ -47,14 +47,14 @@ typedef struct _EphyDownloadWidgetPrivate EphyDownloadWidgetPrivate;
struct _EphyDownloadWidget
{
GtkHBox parent;
GtkBox parent;
EphyDownloadWidgetPrivate *priv;
};
struct _EphyDownloadWidgetClass
{
GtkHBoxClass parent_class;
GtkBoxClass parent_class;
};
GType ephy_download_widget_get_type (void) G_GNUC_CONST;
......
......@@ -116,7 +116,8 @@ ephy_zoom_control_init (EphyZoomControl *control)
i = ephy_zoom_get_zoom_level_index (p->zoom);
gtk_combo_box_set_active (combo, i);
vbox = gtk_vbox_new (TRUE, 0);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_set_homogeneous (GTK_BOX (vbox), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (combo), TRUE, FALSE, 0);
gtk_widget_show (vbox);
......
......@@ -142,7 +142,7 @@ create_tool_item (GtkAction *action)
item = GTK_ACTION_CLASS (ephy_bookmark_action_parent_class)->create_tool_item (action);
hbox = gtk_hbox_new (FALSE, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (item), hbox);
......@@ -161,7 +161,7 @@ create_tool_item (GtkAction *action)
g_signal_connect (entry, "button-press-event",
G_CALLBACK (entry_button_press_event_cb), action);
hbox = gtk_hbox_new (FALSE, 3);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (button), hbox);
......
......@@ -904,7 +904,7 @@ cmd_bookmarks_export (GtkAction *action,
G_CALLBACK (export_format_combo_changed_cb), dialog);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
hbox = gtk_hbox_new (FALSE, 12);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
gtk_widget_show_all (hbox);
......@@ -949,7 +949,7 @@ cmd_bookmarks_import (GtkAction *action,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (content_area), 2);
vbox = gtk_vbox_new (FALSE, 6);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_widget_show (vbox);
gtk_box_pack_start (GTK_BOX (content_area), vbox,
......@@ -1532,7 +1532,7 @@ build_search_box (EphyBookmarksEditor *editor)
GtkWidget *entry;
char *str;
box = gtk_hbox_new (FALSE, 6);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (box), 6);
gtk_widget_show (box);
......@@ -1664,7 +1664,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
g_signal_connect (editor, "delete_event",
G_CALLBACK (delete_event_cb), NULL);
editor->priv->main_vbox = gtk_vbox_new (FALSE, 0);
editor->priv->main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (editor->priv->main_vbox);
gtk_container_add (GTK_CONTAINER (editor), editor->priv->main_vbox);
......@@ -1759,7 +1759,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
G_CALLBACK (keyword_node_show_popup_cb),
editor);
vbox = gtk_vbox_new (FALSE, 0);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_paned_pack2 (GTK_PANED (hpaned), vbox, TRUE, TRUE);
gtk_widget_show (vbox);
......
......@@ -130,7 +130,7 @@ create_tool_item (GtkAction *action)
arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
gtk_widget_show (arrow);
hbox = gtk_hbox_new (FALSE, 3);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (button), hbox);
......
......@@ -543,7 +543,7 @@ ephy_find_toolbar_init (EphyFindToolbar *toolbar)
alignment = gtk_alignment_new (0.0, 0.5, 1.0, 0.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 2, 2);
box = gtk_hbox_new (FALSE, 12);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_add (GTK_CONTAINER (alignment), box);
priv->label = gtk_label_new (NULL);
......
......@@ -202,7 +202,7 @@ ephy_fullscreen_popup_constructor (GType type,
gtk_window_set_resizable (window, FALSE);
hbox = gtk_hbox_new (FALSE, 2);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
gtk_container_add (GTK_CONTAINER (window), hbox);
gtk_widget_show (hbox);
......@@ -211,7 +211,7 @@ ephy_fullscreen_popup_constructor (GType type,
gtk_frame_set_shadow_type (GTK_FRAME (priv->frame), GTK_SHADOW_OUT);
gtk_box_pack_start (GTK_BOX (hbox), priv->frame, FALSE, FALSE, 0);
frame_hbox = gtk_hbox_new (FALSE, 2);
frame_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
gtk_container_add (GTK_CONTAINER (priv->frame), frame_hbox);
gtk_widget_show (frame_hbox);
......
......@@ -933,7 +933,7 @@ build_search_box (EphyHistoryWindow *editor)
GtkWidget *combo;
char *str;
box = gtk_hbox_new (FALSE, 6);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (box), 6);
gtk_widget_show (box);
......@@ -1101,7 +1101,7 @@ ephy_history_window_construct (EphyHistoryWindow *editor)
g_signal_connect (editor, "delete_event",
G_CALLBACK (delete_event_cb), NULL);
editor->priv->main_vbox = gtk_vbox_new (FALSE, 0);
editor->priv->main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (editor->priv->main_vbox);
gtk_container_add (GTK_CONTAINER (editor), editor->priv->main_vbox);
......@@ -1193,7 +1193,7 @@ ephy_history_window_construct (EphyHistoryWindow *editor)
G_CALLBACK (view_selection_changed_cb),
editor);
vbox = gtk_vbox_new (FALSE, 0);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_paned_pack2 (GTK_PANED (hpaned), vbox, TRUE, FALSE);
gtk_widget_show (vbox);
......
......@@ -586,7 +586,7 @@ build_tab_label (EphyNotebook *nb, EphyEmbed *embed)
/* set hbox spacing and label padding (see below) so that there's an
* equal amount of space around the label */
hbox = gtk_hbox_new (FALSE, 4);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_widget_show (hbox);
/* setup load feedback */
......
......@@ -768,7 +768,7 @@ session_command_dispatch (EphySession *session)
session->priv->resume_window = gtk_widget_get_toplevel (GTK_WIDGET (embed));
action_area = gtk_info_bar_get_action_area (GTK_INFO_BAR (info_bar));
button_box = gtk_hbutton_box_new ();
button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (action_area), button_box);
action_button = gtk_button_new_with_label (_("Don't recover"));
......
......@@ -196,7 +196,7 @@ ephy_toolbar_editor_constructor (GType type,
gtk_box_set_spacing (GTK_BOX (EGG_TOOLBAR_EDITOR (editor)), 5);
gtk_box_pack_start (GTK_BOX (vbox), editor, TRUE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 12);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_set_spacing (GTK_BOX (editor), 18);
gtk_box_pack_start (GTK_BOX (editor), hbox, FALSE, FALSE, 0);
......
......@@ -1555,12 +1555,12 @@ setup_ui_manager (EphyWindow *window)
GtkAction *action;
GtkUIManager *manager;
window->priv->main_vbox = gtk_vbox_new (FALSE, 0);
window->priv->main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (window->priv->main_vbox);
gtk_container_add (GTK_CONTAINER (window),
window->priv->main_vbox);
window->priv->menu_dock = gtk_vbox_new (FALSE, 0);
window->priv->menu_dock = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (window->priv->menu_dock);
gtk_box_pack_start (GTK_BOX (window->priv->main_vbox),
GTK_WIDGET (window->priv->menu_dock),
......@@ -3265,7 +3265,7 @@ setup_downloads_box (EphyWindow *window)
GtkWidget *close_button;
GtkWidget *image;
widget = gtk_hbox_new (FALSE, 0);
widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
close_button = gtk_button_new ();
image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_BUTTON);
......
......@@ -366,7 +366,7 @@ pdm_dialog_show_clear_all_dialog (EphyDialog *edialog,
FALSE);
#endif
vbox = gtk_vbox_new (FALSE, 6);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
content_area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog));
gtk_box_pack_start (GTK_BOX (content_area),
vbox, FALSE, FALSE, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment