# HG changeset patch # User Richard Laager # Date 1139895823 0 # Node ID 3de53fe8345f500cd3271f852df40b5698d42364 # Parent 0c50401679d3db66bce0277b3ae00d7c0f73ecc2 [gaim-migrate @ 15646] Always show a vertical scrollbar on conversations imhtmls. This will solve the shrinking conversation window bug. I chose this approach instead of saving the size of the window (as I had previous talked about), as this prevents the contents of the scrollback from rewrapping when the scrollbars appear or disappear. It also just seems to feel like the right thing to do, but maybe that's me being lazy. committer: Tailor Script diff -r 0c50401679d3 -r 3de53fe8345f plugins/ChangeLog.API --- a/plugins/ChangeLog.API Mon Feb 13 22:03:20 2006 +0000 +++ b/plugins/ChangeLog.API Tue Feb 14 05:43:43 2006 +0000 @@ -112,6 +112,7 @@ * All network activity has been updated to use non-blocking sockets. This means that plugins must be updated to expect such a socket from gaim_proxy_connect() and gaim_network_listen*(). + * gaim_gtk_create_imhtml(): Added sw_ret() parameter Removed: * gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute diff -r 0c50401679d3 -r 3de53fe8345f src/gtkconv.c --- a/src/gtkconv.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtkconv.c Tue Feb 14 05:43:43 2006 +0000 @@ -3789,6 +3789,8 @@ GaimConnection *gc; GtkWidget *vpaned, *hpaned; GtkWidget *vbox, *hbox, *frame; + GtkWidget *imhtml_sw; + GtkPolicyType imhtml_sw_hscroll; GtkWidget *lbox, *bbox; GtkWidget *label; GtkWidget *list; @@ -3844,11 +3846,15 @@ gtk_widget_show(hpaned); /* Setup gtkihmtml. */ - frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL); + frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL, &imhtml_sw); gtk_widget_set_name(gtkconv->imhtml, "gaim_gtkconv_imhtml"); gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), TRUE); gtk_paned_pack1(GTK_PANED(hpaned), frame, TRUE, TRUE); gtk_widget_show(frame); + gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW(imhtml_sw), + &imhtml_sw_hscroll, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(imhtml_sw), + imhtml_sw_hscroll, GTK_POLICY_ALWAYS); gtk_widget_set_size_request(gtkconv->imhtml, gaim_prefs_get_int("/gaim/gtk/conversations/chat/default_width"), @@ -3993,7 +3999,7 @@ gtk_widget_show(vbox); /* Setup the toolbar, entry widget and all signals */ - frame = gaim_gtk_create_imhtml(TRUE, >kconv->entry, >kconv->toolbar); + frame = gaim_gtk_create_imhtml(TRUE, >kconv->entry, >kconv->toolbar, NULL); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); gtk_widget_show(frame); @@ -4036,6 +4042,8 @@ { GaimConversation *conv = gtkconv->active_conv; GtkWidget *frame; + GtkWidget *imhtml_sw; + GtkPolicyType imhtml_sw_hscroll; GtkWidget *paned; GtkWidget *vbox; GtkWidget *vbox2; @@ -4051,11 +4059,15 @@ gtk_widget_show(vbox); /* Setup the gtkimhtml widget */ - frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL); + frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL, &imhtml_sw); gtk_widget_set_name(gtkconv->imhtml, "gaim_gtkconv_imhtml"); gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),TRUE); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); gtk_widget_show(frame); + gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW(imhtml_sw), + &imhtml_sw_hscroll, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(imhtml_sw), + imhtml_sw_hscroll, GTK_POLICY_ALWAYS); gtk_widget_set_size_request(gtkconv->imhtml, gaim_prefs_get_int("/gaim/gtk/conversations/im/default_width"), @@ -4084,7 +4096,7 @@ gtk_widget_show(vbox2); /* Setup the toolbar, entry widget and all signals */ - frame = gaim_gtk_create_imhtml(TRUE, >kconv->entry, >kconv->toolbar); + frame = gaim_gtk_create_imhtml(TRUE, >kconv->entry, >kconv->toolbar, NULL); gtk_box_pack_start(GTK_BOX(vbox2), frame, TRUE, TRUE, 0); gtk_widget_show(frame); diff -r 0c50401679d3 -r 3de53fe8345f src/gtkdebug.c --- a/src/gtkdebug.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtkdebug.c Tue Feb 14 05:43:43 2006 +0000 @@ -769,7 +769,7 @@ } /* Add the gtkimhtml */ - frame = gaim_gtk_create_imhtml(FALSE, &win->text, NULL); + frame = gaim_gtk_create_imhtml(FALSE, &win->text, NULL, NULL); gtk_imhtml_set_format_functions(GTK_IMHTML(win->text), GTK_IMHTML_ALL ^ GTK_IMHTML_SMILEY ^ GTK_IMHTML_IMAGE); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); diff -r 0c50401679d3 -r 3de53fe8345f src/gtkdialogs.c --- a/src/gtkdialogs.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtkdialogs.c Tue Feb 14 05:43:43 2006 +0000 @@ -241,7 +241,7 @@ atk_object_set_description(obj, "Gaim " VERSION); gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0); - frame = gaim_gtk_create_imhtml(FALSE, &text, NULL); + frame = gaim_gtk_create_imhtml(FALSE, &text, NULL, NULL); gtk_imhtml_set_format_functions(GTK_IMHTML(text), GTK_IMHTML_ALL ^ GTK_IMHTML_SMILEY); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); diff -r 0c50401679d3 -r 3de53fe8345f src/gtklog.c --- a/src/gtklog.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtklog.c Tue Feb 14 05:43:43 2006 +0000 @@ -410,7 +410,7 @@ gtk_paned_add2(GTK_PANED(pane), vbox); /* Viewer ************/ - frame = gaim_gtk_create_imhtml(FALSE, &lv->imhtml, NULL); + frame = gaim_gtk_create_imhtml(FALSE, &lv->imhtml, NULL, NULL); gtk_widget_set_name(lv->imhtml, "gaim_gtklog_imhtml"); gtk_widget_set_size_request(lv->imhtml, 320, 200); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); diff -r 0c50401679d3 -r 3de53fe8345f src/gtknotify.c --- a/src/gtknotify.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtknotify.c Tue Feb 14 05:43:43 2006 +0000 @@ -532,7 +532,7 @@ gtk_widget_show(label); /* Add the imhtml */ - frame = gaim_gtk_create_imhtml(FALSE, &imhtml, NULL); + frame = gaim_gtk_create_imhtml(FALSE, &imhtml, NULL, NULL); gtk_widget_set_name(imhtml, "gaim_gtknotify_imhtml"); gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), gtk_imhtml_get_format_functions(GTK_IMHTML(imhtml)) | GTK_IMHTML_IMAGE); diff -r 0c50401679d3 -r 3de53fe8345f src/gtkpluginpref.c --- a/src/gtkpluginpref.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtkpluginpref.c Tue Feb 14 05:43:43 2006 +0000 @@ -144,7 +144,7 @@ gtk_box_pack_start(GTK_BOX(hbox), spacer, FALSE, FALSE, 0); gtk_widget_show(spacer); - frame = gaim_gtk_create_imhtml(TRUE, &imhtml, &toolbar); + frame = gaim_gtk_create_imhtml(TRUE, &imhtml, &toolbar, NULL); if (!(format & GAIM_STRING_FORMAT_TYPE_HTML)) gtk_widget_destroy(toolbar); diff -r 0c50401679d3 -r 3de53fe8345f src/gtkprefs.c --- a/src/gtkprefs.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtkprefs.c Tue Feb 14 05:43:43 2006 +0000 @@ -848,7 +848,7 @@ gaim_gtk_prefs_checkbox(_("Use smooth-scrolling"), "/gaim/gtk/conversations/use_smooth_scrolling", vbox); - frame = gaim_gtk_create_imhtml(TRUE, &imhtml, &toolbar); + frame = gaim_gtk_create_imhtml(TRUE, &imhtml, &toolbar, NULL); gtk_widget_set_name(imhtml, "gaim_gtkprefs_font_imhtml"); gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), diff -r 0c50401679d3 -r 3de53fe8345f src/gtkrequest.c --- a/src/gtkrequest.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtkrequest.c Tue Feb 14 05:43:43 2006 +0000 @@ -388,7 +388,7 @@ GtkWidget *frame; /* imhtml */ - frame = gaim_gtk_create_imhtml(TRUE, &entry, &toolbar); + frame = gaim_gtk_create_imhtml(TRUE, &entry, &toolbar, NULL); gtk_widget_set_size_request(entry, 320, 130); gtk_widget_set_name(entry, "gaim_gtkrequest_imhtml"); if (default_value != NULL) diff -r 0c50401679d3 -r 3de53fe8345f src/gtksavedstatuses.c --- a/src/gtksavedstatuses.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtksavedstatuses.c Tue Feb 14 05:43:43 2006 +0000 @@ -1110,7 +1110,7 @@ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); gtk_size_group_add_widget(sg, label); - frame = gaim_gtk_create_imhtml(TRUE, &text, &toolbar); + frame = gaim_gtk_create_imhtml(TRUE, &text, &toolbar, NULL); dialog->message = GTK_IMHTML(text); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0); focus_chain = g_list_prepend(focus_chain, dialog->message); @@ -1446,7 +1446,7 @@ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); gtk_size_group_add_widget(sg, label); - frame = gaim_gtk_create_imhtml(TRUE, &text, &toolbar); + frame = gaim_gtk_create_imhtml(TRUE, &text, &toolbar, NULL); dialog->message = GTK_IMHTML(text); dialog->toolbar = GTK_IMHTMLTOOLBAR(toolbar); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0); diff -r 0c50401679d3 -r 3de53fe8345f src/gtkstatusbox.c --- a/src/gtkstatusbox.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtkstatusbox.c Tue Feb 14 05:43:43 2006 +0000 @@ -936,7 +936,7 @@ #endif status_box->vbox = gtk_vbox_new(0, FALSE); - status_box->sw = gaim_gtk_create_imhtml(FALSE, &status_box->imhtml, NULL); + status_box->sw = gaim_gtk_create_imhtml(FALSE, &status_box->imhtml, NULL, NULL); gtk_imhtml_set_editable(GTK_IMHTML(status_box->imhtml), TRUE); buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(status_box->imhtml)); diff -r 0c50401679d3 -r 3de53fe8345f src/gtkutils.c --- a/src/gtkutils.c Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtkutils.c Tue Feb 14 05:43:43 2006 +0000 @@ -101,7 +101,7 @@ } GtkWidget * -gaim_gtk_create_imhtml(gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret) +gaim_gtk_create_imhtml(gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret) { GtkWidget *frame; GtkWidget *imhtml; @@ -157,6 +157,9 @@ if (editable && (toolbar_ret != NULL)) *toolbar_ret = toolbar; + if (sw_ret != NULL) + *sw_ret = sw; + return frame; } diff -r 0c50401679d3 -r 3de53fe8345f src/gtkutils.h --- a/src/gtkutils.h Mon Feb 13 22:03:20 2006 +0000 +++ b/src/gtkutils.h Tue Feb 14 05:43:43 2006 +0000 @@ -70,18 +70,20 @@ * functions puts both widgets in a nice GtkFrame. They're separate by an * attractive GtkSeparator. * - * @param editable TRUE if this imhtml should be editable. If this is FALSE, + * @param editable @c TRUE if this imhtml should be editable. If this is @c FALSE, * then the toolbar will NOT be created. If this imthml should be * read-only at first, but may become editable later, then pass in - * TRUE here and then manually call gtk_imhtml_set_editable() later. + * @c TRUE here and then manually call gtk_imhtml_set_editable() later. * @param imhtml_ret A pointer to a pointer to a GtkWidget. This pointer * will be set to the imhtml when this function exits. * @param toolbar_ret A pointer to a pointer to a GtkWidget. If editable is * TRUE then this will be set to the toolbar when this function exits. - * Otherwise this will be set to NULL. + * Otherwise this will be set to @c NULL. + * @param sw_ret This will be filled with a pointer to the scrolled window + * widget which contains the imhtml. * @return The GtkFrame containing the toolbar and imhtml. */ -GtkWidget *gaim_gtk_create_imhtml(gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret); +GtkWidget *gaim_gtk_create_imhtml(gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret); /** * Toggles the sensitivity of a widget.