diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-08-26 07:24:38 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-26 07:24:38 +0800 |
commit | afc0306be8552a10b62a31955ef571fdb19edb10 (patch) | |
tree | e6561b1a76d27ffd59328278cdc882a5aba5aa5f /modules/mail | |
parent | 1b706132cf01c2a42cc9a012472b71675cc0902e (diff) | |
download | gsoc2013-evolution-afc0306be8552a10b62a31955ef571fdb19edb10.tar gsoc2013-evolution-afc0306be8552a10b62a31955ef571fdb19edb10.tar.gz gsoc2013-evolution-afc0306be8552a10b62a31955ef571fdb19edb10.tar.bz2 gsoc2013-evolution-afc0306be8552a10b62a31955ef571fdb19edb10.tar.lz gsoc2013-evolution-afc0306be8552a10b62a31955ef571fdb19edb10.tar.xz gsoc2013-evolution-afc0306be8552a10b62a31955ef571fdb19edb10.tar.zst gsoc2013-evolution-afc0306be8552a10b62a31955ef571fdb19edb10.zip |
Switch between classic and vertical view using GtkOrientable.
Diffstat (limited to 'modules/mail')
-rw-r--r-- | modules/mail/e-mail-shell-content.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index 0efe1f1c5a..5f99d744d1 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -839,10 +839,9 @@ e_mail_shell_content_set_vertical_view (EMailShellContent *mail_shell_content, gboolean vertical_view) { GConfBridge *bridge; - GtkWidget *old_paned; - GtkWidget *new_paned; - GtkWidget *child1; - GtkWidget *child2; + GtkOrientable *orientable; + GtkOrientation orientation; + GtkWidget *paned; guint binding_id; const gchar *key; @@ -852,36 +851,28 @@ e_mail_shell_content_set_vertical_view (EMailShellContent *mail_shell_content, return; bridge = gconf_bridge_get (); - old_paned = mail_shell_content->priv->paned; + paned = mail_shell_content->priv->paned; binding_id = mail_shell_content->priv->paned_binding_id; - child1 = gtk_paned_get_child1 (GTK_PANED (old_paned)); - child2 = gtk_paned_get_child2 (GTK_PANED (old_paned)); - if (binding_id > 0) gconf_bridge_unbind (bridge, binding_id); if (vertical_view) { - new_paned = gtk_hpaned_new (); + orientation = GTK_ORIENTATION_HORIZONTAL; key = "/apps/evolution/mail/display/hpaned_size"; } else { - new_paned = gtk_vpaned_new (); + orientation = GTK_ORIENTATION_VERTICAL; key = "/apps/evolution/mail/display/paned_size"; } - gtk_widget_reparent (child1, new_paned); - gtk_widget_reparent (child2, new_paned); - gtk_widget_show (new_paned); - - gtk_widget_destroy (old_paned); - gtk_container_add (GTK_CONTAINER (mail_shell_content), new_paned); + orientable = GTK_ORIENTABLE (paned); + gtk_orientable_set_orientation (orientable, orientation); binding_id = gconf_bridge_bind_property_delayed ( - bridge, key, G_OBJECT (new_paned), "position"); + bridge, key, G_OBJECT (paned), "position"); mail_shell_content->priv->vertical_view = vertical_view; mail_shell_content->priv->paned_binding_id = binding_id; - mail_shell_content->priv->paned = g_object_ref (new_paned); e_mail_shell_content_update_view_instance (mail_shell_content); |