diff options
author | monsta <[email protected]> | 2016-01-22 15:10:28 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-01-22 15:10:28 +0300 |
commit | 3967123299f476612b6d546b0b31c9293b3d5f26 (patch) | |
tree | d7d0e771cdbd38702cfebf0aa37a7f28826a7b30 /mate-dictionary/src | |
parent | 61fc4065c4cdcb49aeab3a38a9da95a043260f50 (diff) | |
download | mate-utils-3967123299f476612b6d546b0b31c9293b3d5f26.tar.bz2 mate-utils-3967123299f476612b6d546b0b31c9293b3d5f26.tar.xz |
[GTK+3] dictionary: (almost) fix deprecated usage of Gtk{H,V}Box
Diffstat (limited to 'mate-dictionary/src')
-rw-r--r-- | mate-dictionary/src/gdict-applet.c | 14 | ||||
-rw-r--r-- | mate-dictionary/src/gdict-sidebar.c | 11 | ||||
-rw-r--r-- | mate-dictionary/src/gdict-sidebar.h | 4 |
3 files changed, 25 insertions, 4 deletions
diff --git a/mate-dictionary/src/gdict-applet.c b/mate-dictionary/src/gdict-applet.c index 726ad85f..009e1502 100644 --- a/mate-dictionary/src/gdict-applet.c +++ b/mate-dictionary/src/gdict-applet.c @@ -333,8 +333,12 @@ gdict_applet_build_window (GdictApplet *applet) gtk_container_add (GTK_CONTAINER (window), frame); gtk_widget_show (frame); priv->frame = frame; - + +#if GTK_CHECK_VERSION (3, 0, 0) + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); +#else vbox = gtk_vbox_new (FALSE, 12); +#endif gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_widget_show (vbox); @@ -512,6 +516,9 @@ gdict_applet_draw (GdictApplet *applet) if (priv->box) gtk_widget_destroy (priv->box); +#if GTK_CHECK_VERSION (3, 0, 0) + box = gtk_box_new (priv->orient, 0); +#else switch (priv->orient) { case GTK_ORIENTATION_VERTICAL: @@ -524,6 +531,7 @@ gdict_applet_draw (GdictApplet *applet) g_assert_not_reached (); break; } +#endif gtk_container_add (GTK_CONTAINER (applet), box); gtk_widget_show (box); @@ -546,7 +554,11 @@ gdict_applet_draw (GdictApplet *applet) gtk_box_pack_start (GTK_BOX (box), priv->toggle, FALSE, FALSE, 0); gtk_widget_show (priv->toggle); +#if GTK_CHECK_VERSION (3, 0, 0) + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); +#else hbox = gtk_hbox_new (FALSE, 0); +#endif gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); gtk_container_add (GTK_CONTAINER (priv->toggle), hbox); gtk_widget_show (hbox); diff --git a/mate-dictionary/src/gdict-sidebar.c b/mate-dictionary/src/gdict-sidebar.c index 38828a76..ae05a2ea 100644 --- a/mate-dictionary/src/gdict-sidebar.c +++ b/mate-dictionary/src/gdict-sidebar.c @@ -73,7 +73,7 @@ enum static guint sidebar_signals[LAST_SIGNAL] = { 0 }; static GQuark sidebar_page_id_quark = 0; -G_DEFINE_TYPE (GdictSidebar, gdict_sidebar, GTK_TYPE_VBOX); +G_DEFINE_TYPE (GdictSidebar, gdict_sidebar, GTK_TYPE_BOX); SidebarPage * sidebar_page_new (const gchar *id, @@ -315,6 +315,7 @@ gdict_sidebar_init (GdictSidebar *sidebar) GtkWidget *close_button; GtkWidget *arrow; + gtk_orientable_set_orientation (GTK_ORIENTABLE (sidebar), GTK_ORIENTATION_VERTICAL); sidebar->priv = priv = GDICT_SIDEBAR_GET_PRIVATE (sidebar); /* we store all the pages inside the list, but we keep @@ -327,7 +328,11 @@ gdict_sidebar_init (GdictSidebar *sidebar) priv->pages_by_id = g_hash_table_new (g_str_hash, g_str_equal); /* top option menu */ +#if GTK_CHECK_VERSION (3, 0, 0) + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); +#else hbox = gtk_hbox_new (FALSE, 0); +#endif gtk_box_pack_start (GTK_BOX (sidebar), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); priv->hbox = hbox; @@ -342,7 +347,11 @@ gdict_sidebar_init (GdictSidebar *sidebar) sidebar); priv->select_button = select_button; +#if GTK_CHECK_VERSION (3, 0, 0) + select_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); +#else select_hbox = gtk_hbox_new (FALSE, 0); +#endif priv->label = gtk_label_new (NULL); #if GTK_CHECK_VERSION (3, 16, 0) diff --git a/mate-dictionary/src/gdict-sidebar.h b/mate-dictionary/src/gdict-sidebar.h index ee0f1b38..4d9b0512 100644 --- a/mate-dictionary/src/gdict-sidebar.h +++ b/mate-dictionary/src/gdict-sidebar.h @@ -39,14 +39,14 @@ typedef struct _GdictSidebarClass GdictSidebarClass; struct _GdictSidebar { - GtkVBox parent_instance; + GtkBox parent_instance; GdictSidebarPrivate *priv; }; struct _GdictSidebarClass { - GtkVBoxClass parent_class; + GtkBoxClass parent_class; void (*page_changed) (GdictSidebar *sidebar); void (*closed) (GdictSidebar *sidebar); |