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