19877302a6
Shortly after the window-list extension was added, it gained a workspace switcher based on the workspace indicator extension. Duplicating the code wasn't a big issue while the switcher was a simple menu, but since it gained previews with a fair bit of custom styling, syncing changes between the two extensions has become tedious, in particular as the two copies have slightly diverged over time. In order to allow the two copies to converge again, the indicator code needs to be separate from the extension boilerplate, so split out the code into a separate module. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
24 lines
791 B
JavaScript
24 lines
791 B
JavaScript
// SPDX-FileCopyrightText: 2011 Erick Pérez Castellanos <erick.red@gmail.com>
|
|
// SPDX-FileCopyrightText: 2011 Giovanni Campagna <gcampagna@src.gnome.org>
|
|
// SPDX-FileCopyrightText: 2017 Florian Müllner <fmuellner@gnome.org>
|
|
//
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js';
|
|
|
|
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
|
|
|
import {WorkspaceIndicator} from './workspaceIndicator.js';
|
|
|
|
export default class WorkspaceIndicatorExtension extends Extension {
|
|
enable() {
|
|
this._indicator = new WorkspaceIndicator();
|
|
Main.panel.addToStatusArea('workspace-indicator', this._indicator);
|
|
}
|
|
|
|
disable() {
|
|
this._indicator.destroy();
|
|
delete this._indicator;
|
|
}
|
|
}
|