summaryrefslogtreecommitdiff
path: root/gtk/gtkpasswordentry.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-03-15 14:35:25 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-03-15 14:35:25 -0400
commitf14d998c9556beee2b8af1381ea9b0b4c76770d0 (patch)
treea9cf5bb2cfa9aa3d779c53d8c73386e59acc50a7 /gtk/gtkpasswordentry.c
parent34e859a5bc65744f34bcb9a594b24fc5d764ecea (diff)
downloadgtk+-f14d998c9556beee2b8af1381ea9b0b4c76770d0.tar.gz
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.
Diffstat (limited to 'gtk/gtkpasswordentry.c')
-rw-r--r--gtk/gtkpasswordentry.c5
1 files changed, 4 insertions, 1 deletions
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]);
}