[gnome-shell/eos3.8: 180/255] eos-payg: Add the character enforcement for payg-tray



commit 09a6fb4eea2427e78f4aa8cdf0e6b6a66c48f8d1
Author: Mazen Asef <mazen asefali gmail com>
Date:   Thu Jun 27 15:34:03 2019 -0300

    eos-payg: Add the character enforcement for payg-tray
    
    As we have set up on the screen unlock, set up the Pay As You Go
    tray applet to enforce the correct characters entered in the field.
    
    https://phabricator.endlessm.com/T25996

 js/ui/payg.js             | 16 +++-------------
 js/ui/paygUnlockDialog.js | 12 +++++++++++-
 2 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/js/ui/payg.js b/js/ui/payg.js
index d64b11cb93..1459b9ae66 100644
--- a/js/ui/payg.js
+++ b/js/ui/payg.js
@@ -54,20 +54,10 @@ var PaygUnlockCodeEntry = GObject.registerClass({
     },
 }, class PaygUnlockCodeEntry extends St.Entry {
 
-    _init() {
-        super._init({
-            style_class: 'unlock-dialog-payg-entry',
-            reactive: true,
-            can_focus: true,
-            x_align: Clutter.ActorAlign.FILL,
-            x_expand: true,
-            y_expand: false,
-        });
+    _init(params) {
+        super._init(params);
 
         this._code = '';
-        this.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
-        this.clutter_text.x_align = Clutter.ActorAlign.CENTER;
-
         this._enabled = false;
         this._buttonPressEventId = this.connect('button-press-event', this._onButtonPressEvent.bind(this));
         this._capturedEventId = this.clutter_text.connect('captured-event', 
this._onCapturedEvent.bind(this));
@@ -427,7 +417,7 @@ var PaygUnlockWidget = GObject.registerClass({
     }
 
     _createCodeEntry() {
-        let codeEntry = new St.Entry({
+        let codeEntry = new PaygUnlockCodeEntry({
             style_class: 'notification-payg-entry',
             x_expand: true,
             can_focus: true,
diff --git a/js/ui/paygUnlockDialog.js b/js/ui/paygUnlockDialog.js
index fc5960f7fb..48086af5a8 100644
--- a/js/ui/paygUnlockDialog.js
+++ b/js/ui/paygUnlockDialog.js
@@ -281,7 +281,17 @@ var PaygUnlockDialog = GObject.registerClass({
             entryBox.add_child(prefix);
         }
 
-        this._entry = new Payg.PaygUnlockCodeEntry();
+        this._entry = new Payg.PaygUnlockCodeEntry({
+            style_class: 'unlock-dialog-payg-entry',
+            reactive: true,
+            can_focus: true,
+            x_align: Clutter.ActorAlign.FILL,
+            x_expand: true,
+            y_expand: false,
+        });
+        this._entry.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
+        this._entry.clutter_text.x_align = Clutter.ActorAlign.CENTER;
+
         entryBox.add_child(this._entry);
 
         if (Main.paygManager.codeFormatSuffix !== '') {


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