Mercurial > pidgin.yaz
comparison pidgin/gtkconv.c @ 20838:effa512ad24a
fix the auto resize code for the showing formatting toolbar case, which
is the default. Previously it wasn't taking the height of the formatting
toolbar into account
Surprisingly I don't see a ticket for this.
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Tue, 09 Oct 2007 03:13:02 +0000 |
parents | ccb728fa5af8 |
children | 83b662c458de |
comparison
equal
deleted
inserted
replaced
20837:ccb728fa5af8 | 20838:effa512ad24a |
---|---|
4369 GtkTextBuffer *buffer; | 4369 GtkTextBuffer *buffer; |
4370 GtkTextIter iter; | 4370 GtkTextIter iter; |
4371 int wrapped_lines; | 4371 int wrapped_lines; |
4372 int lines; | 4372 int lines; |
4373 GdkRectangle oneline; | 4373 GdkRectangle oneline; |
4374 GtkRequisition sr; | 4374 GtkRequisition sr, entry_sr; |
4375 int height; | 4375 int height, diff; |
4376 int pad_top, pad_inside, pad_bottom; | 4376 int pad_top, pad_inside, pad_bottom; |
4377 | 4377 |
4378 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); | 4378 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); |
4379 | 4379 |
4380 wrapped_lines = 1; | 4380 wrapped_lines = 1; |
4396 height = (oneline.height + pad_top + pad_bottom) * lines; | 4396 height = (oneline.height + pad_top + pad_bottom) * lines; |
4397 height += (oneline.height + pad_inside) * (wrapped_lines - lines); | 4397 height += (oneline.height + pad_inside) * (wrapped_lines - lines); |
4398 | 4398 |
4399 gtkconv->auto_resize = TRUE; | 4399 gtkconv->auto_resize = TRUE; |
4400 g_idle_add(reset_auto_resize_cb, gtkconv); | 4400 g_idle_add(reset_auto_resize_cb, gtkconv); |
4401 gtk_widget_size_request(gtkconv->lower_hbox, &sr); | 4401 |
4402 if (sr.height < height + PIDGIN_HIG_BOX_SPACE) { | 4402 gtk_widget_size_request(gtkconv->entry, &entry_sr); |
4403 diff = height - entry_sr.height; | |
4404 | |
4405 if (diff > 0) { | |
4406 gtk_widget_size_request(gtkconv->lower_hbox, &sr); | |
4403 gtkconv->entry_growing = TRUE; | 4407 gtkconv->entry_growing = TRUE; |
4404 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, height + PIDGIN_HIG_BOX_SPACE); | 4408 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, diff + sr.height); |
4405 } | 4409 } |
4406 } | 4410 } |
4407 | 4411 |
4408 static void | 4412 static void |
4409 setup_chat_topic(PidginConversation *gtkconv, GtkWidget *vbox) | 4413 setup_chat_topic(PidginConversation *gtkconv, GtkWidget *vbox) |