2019-02-20 04:12:36 -05:00
|
|
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
|
|
|
const { Clutter, Gio, GLib, St } = imports.gi;
|
|
|
|
const Ripples = imports.ui.ripples;
|
|
|
|
const Main = imports.ui.main;
|
|
|
|
|
|
|
|
const LOCATE_POINTER_KEY = "locate-pointer";
|
|
|
|
const LOCATE_POINTER_SCHEMA = "org.gnome.desktop.interface"
|
|
|
|
|
2019-06-29 08:30:23 -04:00
|
|
|
var LocatePointer = class {
|
2019-02-20 04:12:36 -05:00
|
|
|
constructor() {
|
|
|
|
this._settings = new Gio.Settings({schema_id: LOCATE_POINTER_SCHEMA});
|
|
|
|
this._ripples = new Ripples.Ripples(0.5, 0.5, 'ripple-pointer-location');
|
|
|
|
this._ripples.addTo(Main.uiGroup);
|
|
|
|
}
|
|
|
|
|
|
|
|
show() {
|
2019-06-29 09:22:44 -04:00
|
|
|
if (!this._settings.get_boolean(LOCATE_POINTER_KEY))
|
2019-02-20 04:12:36 -05:00
|
|
|
return;
|
|
|
|
|
|
|
|
let [x, y, mods] = global.get_pointer();
|
|
|
|
this._ripples.playAnimation(x, y);
|
|
|
|
}
|
|
|
|
};
|