light-style: Always save scheme preference on enable()
Disable() should restore the scheme preference that was used when the extension was enabled, not when it was first initialized. Even if it's unlikely to be relevant in practice, let's make sure we save the correct state. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/257>
This commit is contained in:
@@ -21,16 +21,13 @@ const {St} = imports.gi;
|
||||
const Main = imports.ui.main;
|
||||
|
||||
class Extension {
|
||||
constructor() {
|
||||
this._savedColorScheme = Main.sessionMode.colorScheme;
|
||||
}
|
||||
|
||||
_updateColorScheme(scheme) {
|
||||
Main.sessionMode.colorScheme = scheme;
|
||||
St.Settings.get().notify('color-scheme');
|
||||
}
|
||||
|
||||
enable() {
|
||||
this._savedColorScheme = Main.sessionMode.colorScheme;
|
||||
this._updateColorScheme('prefer-light');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user