Skip to content

Commit 8b6d33b

Browse files
committed
PolkitDialog: use Gtk.PasswordEntry
1 parent 9ec7947 commit 8b6d33b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/PolkitDialog.vala

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class Ag.PolkitDialog : Granite.MessageDialog, PantheonWayland.ExtendedBe
4343
private Gtk.Revealer feedback_revealer;
4444
private Gtk.Label password_label;
4545
private Gtk.Label password_feedback;
46-
private Gtk.Entry password_entry;
46+
private Gtk.PasswordEntry password_entry;
4747
private Gtk.ComboBox idents_combo;
4848

4949
public PolkitDialog (string message, string icon_name, string _cookie,
@@ -60,12 +60,10 @@ public class Ag.PolkitDialog : Granite.MessageDialog, PantheonWayland.ExtendedBe
6060
primary_text = _("Authentication Required");
6161
secondary_text = message;
6262

63-
password_entry = new Gtk.Entry () {
63+
password_entry = new Gtk.PasswordEntry () {
6464
activates_default = true,
6565
hexpand = true,
66-
input_purpose = PASSWORD,
67-
primary_icon_name = "dialog-password-symbolic",
68-
primary_icon_tooltip_text = _("Password")
66+
show_peek_icon = true
6967
};
7068

7169
password_feedback = new Gtk.Label (null) {
@@ -219,7 +217,6 @@ public class Ag.PolkitDialog : Granite.MessageDialog, PantheonWayland.ExtendedBe
219217
select_session ();
220218
}
221219

222-
password_entry.secondary_icon_name = "";
223220
feedback_revealer.reveal_child = false;
224221

225222
sensitive = false;
@@ -274,7 +271,6 @@ public class Ag.PolkitDialog : Granite.MessageDialog, PantheonWayland.ExtendedBe
274271
}
275272

276273
private void on_pk_request (string request, bool echo_on) {
277-
password_entry.visibility = echo_on;
278274
if (!request.has_prefix ("Password:")) {
279275
password_label.label = request;
280276
}
@@ -303,7 +299,6 @@ public class Ag.PolkitDialog : Granite.MessageDialog, PantheonWayland.ExtendedBe
303299
iterate = shake.done.connect (() => {
304300
if (repeat_count == 4) {
305301
feedback_revealer.reveal_child = true;
306-
password_entry.secondary_icon_name = "dialog-error-symbolic";
307302
password_feedback.label = text;
308303
sensitive = true;
309304
disconnect (iterate);

0 commit comments

Comments
 (0)