From 668e757b052ca98a6d26e453d19b00d10a0640a9 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Mon, 12 May 2014 19:03:19 +0200 Subject: [PATCH] Use the GtkPaned's position value to store compose_notebook_height, since setting this position is what we're using it for now. Since GtkPaned doesn't have any "resize done" signal available, we have to do it in the notebook's "size-allocate" callback. --- src/compose.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/compose.c b/src/compose.c index 7a1f17731..3e98f2b1d 100644 --- a/src/compose.c +++ b/src/compose.c @@ -368,7 +368,7 @@ static void compose_add_field_list ( Compose *compose, static void compose_notebook_size_alloc (GtkNotebook *notebook, GtkAllocation *allocation, - Compose *compose); + GtkPaned *paned); static gboolean compose_edit_size_alloc (GtkEditable *widget, GtkAllocation *allocation, GtkSHRuler *shruler); @@ -7747,8 +7747,6 @@ static Compose *compose_create(PrefsAccount *account, gtk_text_buffer_add_selection_clipboard(buffer, clipboard); gtk_container_add(GTK_CONTAINER(scrolledwin), text); - g_signal_connect(G_OBJECT(notebook), "size_allocate", - G_CALLBACK(compose_notebook_size_alloc), compose); g_signal_connect_after(G_OBJECT(text), "size_allocate", G_CALLBACK(compose_edit_size_alloc), ruler); @@ -7788,6 +7786,9 @@ static Compose *compose_create(PrefsAccount *account, gtk_paned_pack1(GTK_PANED(paned), notebook, FALSE, FALSE); gtk_paned_pack2(GTK_PANED(paned), edit_vbox, TRUE, FALSE); gtk_paned_set_position(GTK_PANED(paned), prefs_common.compose_notebook_height); + g_signal_connect(G_OBJECT(notebook), "size_allocate", + G_CALLBACK(compose_notebook_size_alloc), paned); + gtk_widget_show_all(paned); @@ -9411,9 +9412,9 @@ static void compose_undo_state_changed(UndoMain *undostruct, gint undo_state, static void compose_notebook_size_alloc(GtkNotebook *notebook, GtkAllocation *allocation, - Compose *compose) + GtkPaned *paned) { - prefs_common.compose_notebook_height = allocation->height; + prefs_common.compose_notebook_height = gtk_paned_get_position(paned); } /* compose_edit_size_alloc() - called when resized. don't know whether Gtk -- 2.25.1