text: Set the readonly accessible property

This mirrors what we already do for GtkTextView.
This commit is contained in:
Matthias Clasen 2020-10-11 23:34:36 -04:00
parent d37b0357b3
commit 2a5af4e1d6

View File

@ -1482,6 +1482,7 @@ gtk_text_class_init (GtkTextClass *class)
"text.redo", NULL);
gtk_widget_class_set_css_name (widget_class, I_("text"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_TEXT_BOX);
}
static void
@ -5430,6 +5431,10 @@ gtk_text_set_editable (GtkText *self,
gtk_text_update_clipboard_actions (self);
gtk_text_update_emoji_action (self);
gtk_accessible_update_property (GTK_ACCESSIBLE (self),
GTK_ACCESSIBLE_PROPERTY_READ_ONLY, !priv->editable,
-1);
g_object_notify (G_OBJECT (self), "editable");
}
}