passwordentry: Show caps lock warning more

Show the caps lock warning regardless of whether we
have the peek icon or not.
This commit is contained in:
Matthias Clasen 2020-04-05 00:30:23 -04:00
parent 90eda2b17c
commit f27470aaf4

View File

@ -89,8 +89,8 @@ keymap_state_changed (GdkKeymap *keymap,
if (gtk_editable_get_editable (GTK_EDITABLE (entry)) && if (gtk_editable_get_editable (GTK_EDITABLE (entry)) &&
gtk_widget_has_focus (priv->entry) && gtk_widget_has_focus (priv->entry) &&
gdk_keymap_get_caps_lock_state (priv->keymap) && !gtk_text_get_visibility (GTK_TEXT (priv->entry)) &&
!priv->peek_icon) gdk_keymap_get_caps_lock_state (priv->keymap))
gtk_widget_show (priv->icon); gtk_widget_show (priv->icon);
else else
gtk_widget_hide (priv->icon); gtk_widget_hide (priv->icon);
@ -133,6 +133,9 @@ visibility_toggled (GObject *object,
gtk_image_set_from_icon_name (GTK_IMAGE (priv->peek_icon), "eye-not-looking-symbolic"); gtk_image_set_from_icon_name (GTK_IMAGE (priv->peek_icon), "eye-not-looking-symbolic");
gtk_widget_set_tooltip_text (priv->peek_icon, _("Show text")); gtk_widget_set_tooltip_text (priv->peek_icon, _("Show text"));
} }
if (priv->keymap)
keymap_state_changed (priv->keymap, GTK_WIDGET (entry));
} }
static void static void