diff options
author | Elliott Sales de Andrade <qulogic@pidgin.im> | 2019-09-02 18:50:08 -0400 |
---|---|---|
committer | Elliott Sales de Andrade <qulogic@pidgin.im> | 2019-09-02 18:50:08 -0400 |
commit | 23b53a0b41004e91ed5ea6f26d3f2672b24c6b16 (patch) | |
tree | 4743294ee51831394bcba10434d5b9f024d95dfb /pidgin/plugins | |
parent | da2da525488f2fa111a4bd19aa82eca87fa0ecc3 (diff) | |
download | pidgin-23b53a0b41004e91ed5ea6f26d3f2672b24c6b16.tar.gz |
Re-enable entry resizing in XMPP console plugin.
It was disabled for WebKit, but we don't use that any more, so it can be
uncommented again.
Diffstat (limited to 'pidgin/plugins')
-rw-r--r-- | pidgin/plugins/xmppconsole/xmppconsole.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pidgin/plugins/xmppconsole/xmppconsole.c b/pidgin/plugins/xmppconsole/xmppconsole.c index aaf7448763..1aad233abe 100644 --- a/pidgin/plugins/xmppconsole/xmppconsole.c +++ b/pidgin/plugins/xmppconsole/xmppconsole.c @@ -268,23 +268,22 @@ entry_changed_cb(GtkTextBuffer *buffer, void *data) { GtkTextIter start, end; char *xmlstr, *str; -#if 0 + GtkTextIter iter; int wrapped_lines; int lines; GdkRectangle oneline; int height; int pad_top, pad_inside, pad_bottom; -#endif PurpleXmlNode *node; GtkStyleContext *style; -#if 0 - /* TODO WebKit: Do entry auto-sizing... */ wrapped_lines = 1; gtk_text_buffer_get_start_iter(buffer, &iter); gtk_text_view_get_iter_location(GTK_TEXT_VIEW(console->entry), &iter, &oneline); - while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(console->entry), &iter)) + while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(console->entry), + &iter)) { wrapped_lines++; + } lines = gtk_text_buffer_get_line_count(buffer); @@ -300,12 +299,13 @@ entry_changed_cb(GtkTextBuffer *buffer, void *data) height += (oneline.height + pad_inside) * (wrapped_lines - lines); gtk_widget_set_size_request(console->sw, -1, height + 6); -#endif gtk_text_buffer_get_bounds(buffer, &start, &end); str = gtk_text_buffer_get_text(buffer, &start, &end, FALSE); - if (!str) + if (!str) { return; + } + xmlstr = g_strdup_printf("<xml>%s</xml>", str); node = purple_xmlnode_from_str(xmlstr, -1); style = gtk_widget_get_style_context(console->entry); |