2013-07-17 19:26:06 +00:00
|
|
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
2019-01-31 14:07:06 +00:00
|
|
|
/* exported Indicator */
|
2013-07-17 19:26:06 +00:00
|
|
|
|
2019-07-16 09:24:13 +00:00
|
|
|
const GObject = imports.gi.GObject;
|
|
|
|
|
2013-07-17 19:26:06 +00:00
|
|
|
const Main = imports.ui.main;
|
|
|
|
const PanelMenu = imports.ui.panelMenu;
|
|
|
|
|
2019-10-28 18:35:33 +00:00
|
|
|
var Indicator = GObject.registerClass(
|
|
|
|
class Indicator extends PanelMenu.SystemIndicator {
|
2019-07-16 09:24:13 +00:00
|
|
|
_init() {
|
|
|
|
super._init();
|
2013-07-17 19:26:06 +00:00
|
|
|
|
|
|
|
this._indicator = this._addIndicator();
|
|
|
|
this._indicator.icon_name = 'media-record-symbolic';
|
|
|
|
this._indicator.add_style_class_name('screencast-indicator');
|
|
|
|
this._sync();
|
|
|
|
|
2017-12-02 00:27:35 +00:00
|
|
|
Main.screencastService.connect('updated', this._sync.bind(this));
|
2017-10-31 01:19:44 +00:00
|
|
|
}
|
2013-07-17 19:26:06 +00:00
|
|
|
|
2017-10-31 00:03:21 +00:00
|
|
|
_sync() {
|
2013-07-17 19:26:06 +00:00
|
|
|
this._indicator.visible = Main.screencastService.isRecording;
|
2017-10-31 01:19:44 +00:00
|
|
|
}
|
2019-07-16 09:24:13 +00:00
|
|
|
});
|