[gnome-shell/gbsneto/remove-generic-container: 15/21] inspector: Stop using Shell.GenericContainer



commit 57ee3b41a6f00e0c39b015cde5da55608edbc2bc
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Jul 9 09:49:37 2018 +0200

    inspector: Stop using Shell.GenericContainer
    
    No alarms and no surprises here.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153

 js/ui/lookingGlass.js | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index ea5b759ec..34c60cb65 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -4,6 +4,7 @@ const Clutter = imports.gi.Clutter;
 const Cogl = imports.gi.Cogl;
 const GLib = imports.gi.GLib;
 const Gio = imports.gi.Gio;
+const GObject = imports.gi.GObject;
 const Gtk = imports.gi.Gtk;
 const Meta = imports.gi.Meta;
 const Pango = imports.gi.Pango;
@@ -501,18 +502,21 @@ var RedBorderEffect = new Lang.Class({
 
 var Inspector = new Lang.Class({
     Name: 'Inspector',
+    Extends: Clutter.Actor,
+    Signals: { 'closed': {},
+               'target': { param_types: [Clutter.Actor.$gtype, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] } },
 
     _init(lookingGlass) {
-        let container = new Shell.GenericContainer({ width: 0,
-                                                     height: 0 });
-        container.connect('allocate', this._allocate.bind(this));
-        Main.uiGroup.add_actor(container);
+        this.parent({ width: 0,
+                      height: 0 });
+
+        Main.uiGroup.add_actor(this);
 
         let eventHandler = new St.BoxLayout({ name: 'LookingGlassDialog',
                                               vertical: false,
                                               reactive: true });
         this._eventHandler = eventHandler;
-        container.add_actor(eventHandler);
+        this.add_actor(eventHandler);
         this._displayText = new St.Label();
         eventHandler.add(this._displayText, { expand: true });
 
@@ -534,7 +538,9 @@ var Inspector = new Lang.Class({
         this._lookingGlass = lookingGlass;
     },
 
-    _allocate(actor, box, flags) {
+    vfunc_allocate(box, flags) {
+        this.set_allocation(box, flags);
+
         if (!this._eventHandler)
             return;
 
@@ -631,8 +637,6 @@ var Inspector = new Lang.Class({
     }
 });
 
-Signals.addSignalMethods(Inspector.prototype);
-
 var Extensions = new Lang.Class({
     Name: 'Extensions',
 


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