[gtk] password entry: Don't show both icons
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] password entry: Don't show both icons
- Date: Fri, 15 Mar 2019 18:37:55 +0000 (UTC)
commit f14d998c9556beee2b8af1381ea9b0b4c76770d0
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Mar 15 14:35:25 2019 -0400
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]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]