pidgin/gtkconv.c

branch
cpw.qulogic.gtk3
changeset 32402
188ce0465fb6
parent 32400
e68ef2563a05
child 32403
1b8edcd184f0
equal deleted inserted replaced
32401:72ec07a21f14 32402:188ce0465fb6
4673 int max_height; 4673 int max_height;
4674 int min_lines = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines"); 4674 int min_lines = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines");
4675 int min_height; 4675 int min_height;
4676 gboolean interior_focus; 4676 gboolean interior_focus;
4677 int focus_width; 4677 int focus_width;
4678 GtkAllocation imhtml_allocation; 4678 GtkAllocation imhtml_allocation;
4679 GtkAllocation entry_allocation; 4679 GtkAllocation entry_allocation;
4680 GtkAllocation lower_hbox_allocation; 4680 GtkAllocation lower_hbox_allocation;
4681 4681
4682 gtk_widget_get_allocation(gtkconv->imhtml, &imhtml_allocation); 4682 gtk_widget_get_allocation(gtkconv->imhtml, &imhtml_allocation);
4683 gtk_widget_get_allocation(gtkconv->entry, &entry_allocation); 4683 gtk_widget_get_allocation(gtkconv->entry, &entry_allocation);
4684 gtk_widget_get_allocation(gtkconv->lower_hbox, &lower_hbox_allocation); 4684 gtk_widget_get_allocation(gtkconv->lower_hbox, &lower_hbox_allocation);
4685 total_height = imhtml_allocation.height + entry_allocation.height; 4685 total_height = imhtml_allocation.height + entry_allocation.height;
4686 max_height = total_height / 2; 4686 max_height = total_height / 2;
4687 4687
4688 pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry)); 4688 pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry));
4689 pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry)); 4689 pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry));
4690 pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(gtkconv->entry)); 4690 pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(gtkconv->entry));
4691 4691
4718 height += 2 * focus_width; 4718 height += 2 * focus_width;
4719 4719
4720 diff = height - entry_allocation.height; 4720 diff = height - entry_allocation.height;
4721 if (ABS(diff) < oneline.height / 2) 4721 if (ABS(diff) < oneline.height / 2)
4722 return FALSE; 4722 return FALSE;
4723
4724 purple_debug_info("pidgin", "resizing to %d, %d lines\n",
4725 lower_hbox_allocation.height, min_lines);
4723 4726
4724 gtk_widget_set_size_request(gtkconv->lower_hbox, -1, 4727 gtk_widget_set_size_request(gtkconv->lower_hbox, -1,
4725 diff + lower_hbox_allocation.height); 4728 diff + lower_hbox_allocation.height);
4726 4729
4727 return FALSE; 4730 return FALSE;
7307 gtk_notebook_get_tab_pos(notebook) == GTK_POS_BOTTOM); 7310 gtk_notebook_get_tab_pos(notebook) == GTK_POS_BOTTOM);
7308 7311
7309 count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook)); 7312 count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook));
7310 7313
7311 for (i = 0; i < count; i++) { 7314 for (i = 0; i < count; i++) {
7312 GtkAllocation allocation; 7315 GtkAllocation allocation;
7313 7316
7314 gtk_widget_get_allocation(tab, &allocation);
7315 page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i); 7317 page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i);
7316 tab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), page); 7318 tab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), page);
7319 gtk_widget_get_allocation(tab, &allocation);
7317 7320
7318 /* Make sure the tab is not hidden beyond an arrow */ 7321 /* Make sure the tab is not hidden beyond an arrow */
7319 if (!gtk_widget_is_drawable(tab) && gtk_notebook_get_show_tabs(notebook)) 7322 if (!gtk_widget_is_drawable(tab) && gtk_notebook_get_show_tabs(notebook))
7320 continue; 7323 continue;
7321 7324

mercurial