From f14d998c9556beee2b8af1381ea9b0b4c76770d0 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 15 Mar 2019 14:35:25 -0400 Subject: [PATCH] password entry: Don't show both icons It can be a bit confusing to have an indicator and an action next to each other, and with the peek icon, the need for the Caps Lock warning is reduced, since you can just reveal the text to see that it is capitalized. Therefore, only show the Caps Lock warning if the peek icon is disabled. --- gtk/gtkpasswordentry.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c index 7dc6603a59..ef6f1d815b 100644 --- a/gtk/gtkpasswordentry.c +++ b/gtk/gtkpasswordentry.c @@ -85,7 +85,8 @@ keymap_state_changed (GdkKeymap *keymap, if (gtk_editable_get_editable (GTK_EDITABLE (entry)) && gtk_widget_has_focus (priv->entry) && - gdk_keymap_get_caps_lock_state (priv->keymap)) + gdk_keymap_get_caps_lock_state (priv->keymap) && + !priv->peek_icon) gtk_widget_show (priv->icon); else gtk_widget_hide (priv->icon); @@ -449,6 +450,8 @@ gtk_password_entry_set_show_peek_icon (GtkPasswordEntry *entry, gtk_text_set_visibility (GTK_TEXT (priv->entry), FALSE); } + keymap_state_changed (priv->keymap, GTK_WIDGET (entry)); + g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_SHOW_PEEK_ICON]); }