password entry: Use text cursor for Caps Lock indicator

We don't want it to appear clickable, but we still
need to keep it pickable for the tooltip to work,
so explicitly give it the same cursor that we use
for the text.
This commit is contained in:
Matthias Clasen 2019-03-14 19:17:39 -04:00
parent c3f43cf1f2
commit 470720e11a

View File

@ -118,6 +118,7 @@ gtk_password_entry_init (GtkPasswordEntry *entry)
priv->icon = gtk_image_new_from_icon_name ("caps-lock-symbolic");
gtk_widget_set_tooltip_text (priv->icon, _("Caps Lock is on"));
gtk_widget_set_cursor (priv->icon, gtk_widget_get_cursor (priv->entry));
gtk_container_add (GTK_CONTAINER (priv->box), priv->icon);
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (entry)), I_("password"));