mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
cleanup: Use destructuring for imports from GI
This is *much* nicer than repetitive "imports.gi" lines ... https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/399
This commit is contained in:
parent
a1534dab02
commit
fd50b9a45e
124 changed files with 150 additions and 595 deletions
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage({ width: 640, height: 480 });
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Cogl = imports.gi.Cogl;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Cogl, Clutter, St } = imports.gi;
|
||||
|
||||
|
||||
function test() {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage({ width: 640, height: 480 });
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage({ width: 640, height: 480 });
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage({ width: 640, height: 480 });
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage();
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, GLib, St } = imports.gi;
|
||||
const Mainloop = imports.mainloop;
|
||||
const GLib = imports.gi.GLib;
|
||||
|
||||
const DELAY = 2000;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage({ width: 640, height: 480 });
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage({ width: 400, height: 400 });
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage();
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const { Clutter, St } = imports.gi;
|
||||
const Mainloop = imports.mainloop;
|
||||
const St = imports.gi.St;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage({ width: 400, height: 400 });
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
#!/usr/bin/env gjs
|
||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
imports.gi.versions.Gdk = '3.0';
|
||||
imports.gi.versions.Gtk = '3.0';
|
||||
|
||||
const Gdk = imports.gi.Gdk;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
imports.gi.versions = { Gdk: '3.0', Gtk: '3.0' };
|
||||
const { Gdk, Gio, GLib, Gtk } = imports.gi;
|
||||
|
||||
function do_action(action, parameter) {
|
||||
print ("Action '" + action.name + "' invoked");
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage();
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage();
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, GObject, Gtk, Shell, St } = imports.gi;
|
||||
|
||||
// This is an interactive test of the sizing behavior of StScrollView. It
|
||||
// may be interesting in the future to split out the two classes at the
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, Gtk, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage();
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const St = imports.gi.St;
|
||||
const { Clutter, St } = imports.gi;
|
||||
|
||||
function test() {
|
||||
let stage = new Clutter.Stage();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue