extensionSystem: Implement new live enable/disable system
The rough sketches of the system are outlined here: http://mail.gnome.org/archives/gnome-shell-list/2011-June/msg00283.html Additionally, enable/disable extensions when the 'enabled-extensions' setting changes. Two new DBus methods, "EnableExtension" and "DisableExtension" allow users to manipulate this setting quite easily. https://bugzilla.gnome.org/show_bug.cgi?id=654770
This commit is contained in:
@ -33,7 +33,7 @@ const St = imports.gi.St;
|
||||
const Main = imports.ui.main;
|
||||
const Tweener = imports.ui.tweener;
|
||||
|
||||
let text;
|
||||
let text, button;
|
||||
|
||||
function _hideHello() {
|
||||
Main.uiGroup.remove_actor(text);
|
||||
@ -60,22 +60,28 @@ function _showHello() {
|
||||
onComplete: _hideHello });
|
||||
}
|
||||
|
||||
function main() {
|
||||
let button = new St.Bin({ style_class: 'panel-button',
|
||||
reactive: true,
|
||||
can_focus: true,
|
||||
x_fill: true,
|
||||
y_fill: false,
|
||||
track_hover: true });
|
||||
function init() {
|
||||
button = new St.Bin({ style_class: 'panel-button',
|
||||
reactive: true,
|
||||
can_focus: true,
|
||||
x_fill: true,
|
||||
y_fill: false,
|
||||
track_hover: true });
|
||||
let icon = new St.Icon({ icon_name: 'system-run',
|
||||
icon_type: St.IconType.SYMBOLIC,
|
||||
style_class: 'system-status-icon' });
|
||||
|
||||
button.set_child(icon);
|
||||
button.connect('button-press-event', _showHello);
|
||||
}
|
||||
|
||||
function enable() {
|
||||
Main.panel._rightBox.insert_actor(button, 0);
|
||||
}
|
||||
|
||||
function disable() {
|
||||
Main.panel._rightBox.remove_actor(button);
|
||||
}
|
||||
""",
|
||||
|
||||
"stylesheet.css": """
|
||||
|
Reference in New Issue
Block a user