# HG changeset patch # User Sean Egan # Date 1169027275 0 # Node ID db11d9e416ac6c2c8d28891854be97757fb0a397 # Parent 445b2bee14b9603b1bcb697d4f241bfa003f4066 [gaim-migrate @ 18147] when auto-growing a conversation entry to fit text without scrollbars, reset to the default size once the message is sent committer: Tailor Script diff -r 445b2bee14b9 -r db11d9e416ac gtk/gtkconv.c --- a/gtk/gtkconv.c Wed Jan 17 09:22:04 2007 +0000 +++ b/gtk/gtkconv.c Wed Jan 17 09:47:55 2007 +0000 @@ -451,6 +451,18 @@ gtkconv->send_history = g_list_prepend(first, NULL); } +static void +reset_default_size(GaimGtkConversation *gtkconv) +{ + GaimConversation *conv = gtkconv->active_conv; + if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) + gtk_widget_set_size_request(gtkconv->lower_hbox, -1, + gaim_prefs_get_int("/gaim/gtk/conversations/chat/entry_height")); + else + gtk_widget_set_size_request(gtkconv->lower_hbox, -1, + gaim_prefs_get_int("/gaim/gtk/conversations/im/entry_height")); +} + static gboolean check_for_and_do_command(GaimConversation *conv) { @@ -537,6 +549,10 @@ return; if (check_for_and_do_command(conv)) { + if (gtkconv->entry_growing) { + reset_default_size(gtkconv); + gtkconv->entry_growing = FALSE; + } gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); return; } @@ -586,6 +602,10 @@ g_free(buf); gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); + if (gtkconv->entry_growing) { + reset_default_size(gtkconv); + gtkconv->entry_growing = FALSE; + } gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); } @@ -3992,6 +4012,7 @@ gtk_widget_size_request(gtkconv->lower_hbox, &sr); if (sr.height < height + GAIM_HIG_BOX_SPACE) { gtkconv->auto_resize = TRUE; + gtkconv->entry_growing = TRUE; gtk_widget_set_size_request(gtkconv->lower_hbox, -1, height + GAIM_HIG_BOX_SPACE); g_idle_add(reset_auto_resize_cb, gtkconv); } diff -r 445b2bee14b9 -r db11d9e416ac gtk/gtkconv.h --- a/gtk/gtkconv.h Wed Jan 17 09:22:04 2007 +0000 +++ b/gtk/gtkconv.h Wed Jan 17 09:47:55 2007 +0000 @@ -131,6 +131,9 @@ * is being resized by a non-user-initiated * event, such as the buddy icon appearing */ + gboolean entry_growing; /* True if the size of the entry was set + * automatically by typing too much to fit + * in one line */ GtkWidget *close; /* "x" on the tab */ GtkWidget *icon;