status/camera: New indicator

Add a new status indicator following the system-status-indicators
mockup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2840>
This commit is contained in:
robert.mader@collabora.com
2023-07-13 23:34:30 +02:00
parent d09d24666a
commit 63c3f3e7be
3 changed files with 27 additions and 0 deletions

22
js/ui/status/camera.js Normal file
View File

@ -0,0 +1,22 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported Indicator */
const GObject = imports.gi.GObject;
const Shell = imports.gi.Shell;
const {SystemIndicator} = imports.ui.quickSettings;
var Indicator = GObject.registerClass(
class Indicator extends SystemIndicator {
constructor() {
super();
this._indicator = this._addIndicator();
this._indicator.icon_name = 'camera-web-symbolic';
this._indicator.add_style_class_name('privacy-indicator');
this._cameraMonitor = new Shell.CameraMonitor();
this._cameraMonitor.bind_property('cameras-in-use', this._indicator,
'visible', GObject.BindingFlags.SYNC_CREATE);
}
});