diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-04-09 11:19:45 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-04-09 11:21:54 +0800 |
commit | e17db00f41d85ef48088fd29c2c55f82875682bd (patch) | |
tree | c3009f98e42556ab6950102b29a3142ec6221615 /shell/e-shell-view.c | |
parent | a74acbf19734f875d8b0bd5abf2570c762d5626c (diff) | |
download | gsoc2013-evolution-e17db00f41d85ef48088fd29c2c55f82875682bd.tar.gz gsoc2013-evolution-e17db00f41d85ef48088fd29c2c55f82875682bd.tar.zst gsoc2013-evolution-e17db00f41d85ef48088fd29c2c55f82875682bd.zip |
Add e_shell_view_get_size_group().
Returns a GtkSizeGroup used to keep the search bar and sidebar banner
vertically aligned.
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r-- | shell/e-shell-view.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index f13b7c8d69..1cc0efdfc8 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -59,6 +59,7 @@ struct _EShellViewPrivate { guint merge_id; GtkAction *action; + GtkSizeGroup *size_group; GtkWidget *shell_content; GtkWidget *shell_sidebar; GtkWidget *shell_taskbar; @@ -613,6 +614,10 @@ shell_view_constructed (GObject *object) shell_view->priv->searchbar = g_object_ref_sink (widget); } + /* Size group should be safe to unreference now. */ + g_object_unref (shell_view->priv->size_group); + shell_view->priv->size_group = NULL; + /* Update actions whenever the Preferences window is closed. */ widget = e_shell_get_preferences_window (shell); shell_view->priv->preferences_window = g_object_ref (widget); @@ -1028,6 +1033,8 @@ static void e_shell_view_init (EShellView *shell_view, EShellViewClass *class) { + GtkSizeGroup *size_group; + /* XXX Our use of GInstanceInitFunc's 'class' parameter * prevents us from using G_DEFINE_ABSTRACT_TYPE. */ @@ -1037,8 +1044,11 @@ e_shell_view_init (EShellView *shell_view, if (class->view_collection == NULL) shell_view_init_view_collection (class); + size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL); + shell_view->priv = E_SHELL_VIEW_GET_PRIVATE (shell_view); shell_view->priv->state_key_file = g_key_file_new (); + shell_view->priv->size_group = size_group; } GType @@ -1411,6 +1421,26 @@ e_shell_view_get_search_query (EShellView *shell_view) } /** + * e_shell_view_get_size_group: + * @shell_view: an #EShellView + * + * Returns a #GtkSizeGroup that #EShellContent and #EShellSidebar use + * to keep the search bar and sidebar banner vertically aligned. The + * rest of the application should have no need for this. + * + * Note, this is only available during #EShellView construction. + * + * Returns: a #GtkSizeGroup for internal use + **/ +GtkSizeGroup * +e_shell_view_get_size_group (EShellView *shell_view) +{ + g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL); + + return shell_view->priv->size_group; +} + +/** * e_shell_view_get_shell_backend: * @shell_view: an #EShellView * |