[gnome-shell/wip/lockdown-show-password: 3/4] shellEntry: Handle password item from dedication function
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/lockdown-show-password: 3/4] shellEntry: Handle password item from dedication function
- Date: Wed, 21 Aug 2019 20:36:15 +0000 (UTC)
commit 0ee58a292a25ff2bd06a99563289352b21acac58
Author: Ray Strode <rstrode redhat com>
Date: Wed Aug 21 15:06:46 2019 -0400
shellEntry: Handle password item from dedication function
At the moment, shellEntry handles creating and destroying its
"Show Text" password menu item directly from its isPassword
setter function.
This commit moves that handling to a dedicated _resetPasswordItem
function, as prep work for adding lockdown support of the "Show Text"
menu item.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/687
js/ui/shellEntry.js | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
index e01a53e409..653b581dc4 100644
--- a/js/ui/shellEntry.js
+++ b/js/ui/shellEntry.js
@@ -41,6 +41,19 @@ var EntryMenu = class extends PopupMenu.PopupMenu {
this._updatePasswordItem();
}
+ _resetPasswordItem() {
+ if (!this.isPassword) {
+ if (this._passwordItem) {
+ this._passwordItem.destroy();
+ this._passwordItem = null;
+ }
+ this._entry.clutter_text.set_password_char('\u25cf');
+ } else {
+ if (!this._passwordItem)
+ this._makePasswordItem();
+ }
+ }
+
get isPassword() {
return this._entry.input_purpose == Clutter.InputContentPurpose.PASSWORD;
}
@@ -49,14 +62,12 @@ var EntryMenu = class extends PopupMenu.PopupMenu {
if (v == this.isPassword)
return;
- if (v) {
- this._makePasswordItem();
+ if (v)
this._entry.input_purpose = Clutter.InputContentPurpose.PASSWORD;
- } else {
- this._passwordItem.destroy();
- this._passwordItem = null;
+ else
this._entry.input_purpose = Clutter.InputContentPurpose.NORMAL;
- }
+
+ this._resetPasswordItem();
}
open(animate) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]