Tue, 20 Dec 2005 23:57:02 +0000
[gaim-migrate @ 14913]
Relatively, this is a massively minor change, but in the few times I've
used Status, I've often found myself wanting to change from Available to
Away while keeping the same message. Instead of clearing the imhtml,
this selects all the text in it, so you can just start typing to change the
message, or leave it alone to keep it the same. Cool?
| src/gtkstatusbox.c | file | annotate | diff | comparison | revisions |
--- a/src/gtkstatusbox.c Tue Dec 20 23:16:56 2005 +0000 +++ b/src/gtkstatusbox.c Tue Dec 20 23:57:02 2005 +0000 @@ -1067,6 +1067,8 @@ if (status_box->imhtml_visible) { + GtkTextBuffer *buf; + GtkTextIter start, end; gtk_widget_show_all(status_box->vbox); if (GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(status_box))) { status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); @@ -1074,9 +1076,12 @@ gtk_widget_hide(status_box->toolbar); gtk_widget_hide(status_box->hsep); } - gtk_imhtml_clear(GTK_IMHTML(status_box->imhtml)); - gtk_imhtml_clear_formatting(GTK_IMHTML(status_box->imhtml)); - gtk_widget_grab_focus(status_box->imhtml); + gtk_widget_grab_focus(status_box->imhtml); + buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(status_box->imhtml)); + gtk_text_buffer_get_start_iter(buf, &start); + gtk_text_buffer_get_end_iter(buf, &end); + gtk_text_buffer_move_mark_by_name(buf, "insert", &end); + gtk_text_buffer_move_mark_by_name(buf, "selection_bound", &start); } else {