From efb34b1073ffa79827e9a2b2f3d1f04f8ef0a9f3 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Sat, 21 Jul 2001 04:46:58 +0000 Subject: Change window policy to allow the completion window to shrink when the 2001-07-20 Jon Trowbridge * gal/e-text/e-entry.c (e_entry_enable_completion_full): Change window policy to allow the completion window to shrink when the number of options decreases. * gal/e-text/e-completion-view.c (e_completion_view_construct): Removed some obsolete code. svn path=/trunk/; revision=11292 --- widgets/text/e-completion-view.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'widgets/text/e-completion-view.c') diff --git a/widgets/text/e-completion-view.c b/widgets/text/e-completion-view.c index 0ff5cddc79..fe38e1fe0f 100644 --- a/widgets/text/e-completion-view.c +++ b/widgets/text/e-completion-view.c @@ -690,16 +690,9 @@ e_completion_view_construct (ECompletionView *cv, ECompletion *completion) e_scroll_frame_set_scrollbar_spacing (E_SCROLL_FRAME (cv->table), 0); e_scroll_frame_set_policy (E_SCROLL_FRAME (cv->table), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); -#if 0 - frame = gtk_frame_new (NULL); - - gtk_container_add (GTK_CONTAINER (cv), frame); - gtk_container_add (GTK_CONTAINER (frame), cv->table); - gtk_widget_show_all (frame); -#else gtk_container_add (GTK_CONTAINER (cv), cv->table); gtk_widget_show_all (cv->table); -#endif + gtk_signal_connect (GTK_OBJECT (e_completion_view_table (cv)), "click", GTK_SIGNAL_FUNC (table_click_cb), @@ -771,7 +764,7 @@ void e_completion_view_set_width (ECompletionView *cv, gint width) { GtkWidget *w; - gint y, r, dummy, line_height; + gint y, r, dummy, line_height, final_height; double drop_room, lines; g_return_if_fail (cv != NULL); @@ -811,7 +804,12 @@ e_completion_view_set_width (ECompletionView *cv, gint width) lines = MIN (lines, drop_room); /* We reduce the total height by a bit; in practice, this seems to work out well. */ - gtk_widget_set_usize (w, width, (gint) floor (line_height * (0.5 + (float)lines) * 0.97)); + final_height = (gint) floor (line_height * (0.5 + (float)lines) * 0.97); + //while (w->parent) + //w = w->parent; + gtk_widget_set_usize (w, width, final_height); + + g_message ("usize: %d %d", width, final_height); } void -- cgit v1.2.3