Merge branch 'ebassi/password-entry-notify' into 'master'

Notify properties on deletion in PasswordEntryBuffer

Closes #3484

See merge request GNOME/gtk!2969
This commit is contained in:
Emmanuele Bassi 2020-12-17 15:51:04 +00:00
commit ec94ec0286
2 changed files with 13 additions and 2 deletions

View File

@ -133,8 +133,8 @@
* }
* ]|
*
* Finally, use gtk_editable_delegate_set_property() in your set_property
* function (and similar for get_property), to set the editable properties:
* Finally, use gtk_editable_delegate_set_property() in your `set_property`
* function (and similar for `get_property`), to set the editable properties:
*
* |[
* ...
@ -144,6 +144,14 @@
* switch (prop_id)
* ...
* ]|
*
* It is important to note that if you create a GtkEditable that uses a delegate,
* the low level #GtkEditable::insert-text and #GtkEditable::delete-text signals
* will be propagated from the "wrapper" editable to the delegate, but they will
* not be propagated from the delegate to the "wrapper" editable, as they would
* cause an infinite recursion. If you wish to connect to the #GtkEditable::insert-text
* and #GtkEditable::delete-text signals, you will need to connect to them on
* the delegate obtained via gtk_editable_get_delegate().
*/
#include "config.h"

View File

@ -135,6 +135,9 @@ gtk_password_entry_buffer_real_deleted_text (GtkEntryBuffer *buffer,
memmove (self->text + start, self->text + end, self->text_bytes + 1 - end);
self->text_chars -= n_chars;
self->text_bytes -= (end - start);
g_object_notify (G_OBJECT (buffer), "text");
g_object_notify (G_OBJECT (buffer), "length");
}
static guint