[file-roller] gtk-utils: Use the same password reveal icon as GTK 4



commit 63121baa48fbe77c99ac2a1a5018d359eeac1861
Author: Jan Tojnar <jtojnar gmail com>
Date:   Tue Jun 21 12:55:29 2022 +0200

    gtk-utils: Use the same password reveal icon as GTK 4

 src/gtk-utils.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/gtk-utils.c b/src/gtk-utils.c
index a807df63..d2e54022 100644
--- a/src/gtk-utils.c
+++ b/src/gtk-utils.c
@@ -572,7 +572,13 @@ password_entry_icon_press_cb (GtkEntry            *entry,
                              GdkEvent            *event,
                              gpointer             user_data)
 {
-       gtk_entry_set_visibility (entry, ! gtk_entry_get_visibility (entry));
+       gboolean visibility = gtk_entry_get_visibility (entry);
+       gtk_entry_set_visibility (entry, ! visibility);
+       if (visibility) {
+               gtk_entry_set_icon_from_icon_name (entry, GTK_ENTRY_ICON_SECONDARY, "view-reveal-symbolic");
+       } else {
+               gtk_entry_set_icon_from_icon_name (entry, GTK_ENTRY_ICON_SECONDARY, "view-conceal-symbolic");
+       }
 }
 
 
@@ -580,7 +586,7 @@ void
 _gtk_entry_use_as_password_entry (GtkEntry *entry)
 {
        gtk_entry_set_visibility (entry, FALSE);
-       gtk_entry_set_icon_from_icon_name (entry, GTK_ENTRY_ICON_SECONDARY, "security-medium-symbolic");
+       gtk_entry_set_icon_from_icon_name (entry, GTK_ENTRY_ICON_SECONDARY, "view-reveal-symbolic");
        gtk_entry_set_icon_activatable (entry, GTK_ENTRY_ICON_SECONDARY, TRUE);
        gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_SECONDARY, _("Change password visibility"));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]