JustPerfection extension review fixes

This commit is contained in:
Marcin Jakubowski
2021-12-07 09:52:33 +01:00
parent 8ca4f52169
commit 8273f4228f
2 changed files with 3 additions and 11 deletions
+2 -2
View File
@@ -146,14 +146,12 @@ class Extension {
constructor() { constructor() {
this._previous_y_align = BannerBin.get_y_align(); this._previous_y_align = BannerBin.get_y_align();
this._previous_x_align = BannerBin.get_x_align(); this._previous_x_align = BannerBin.get_x_align();
this._loadSettings();
} }
_loadSettings() { _loadSettings() {
this._settings = Prefs.SettingsSchema; this._settings = Prefs.SettingsSchema;
this._settingsChangedId = this._settings.connect('changed', this._settingsChangedId = this._settings.connect('changed',
Lang.bind(this, this._onSettingsChange)); Lang.bind(this, this._onSettingsChange));
this._fetchSettings(); this._fetchSettings();
} }
@@ -170,6 +168,7 @@ class Extension {
} }
enable() { enable() {
this._loadSettings();
// generally alignment can be controller with START/CENTER/END // generally alignment can be controller with START/CENTER/END
// but CENTER and END are problematic to implement animations with // but CENTER and END are problematic to implement animations with
// (especially x -> END and animations from left/right) // (especially x -> END and animations from left/right)
@@ -192,6 +191,7 @@ class Extension {
BannerBin.x = 0 BannerBin.x = 0
BannerBin.y = 0 BannerBin.y = 0
this.restore() this.restore()
this._settings = null;
} }
+1 -9
View File
@@ -43,15 +43,7 @@ var Fields = {
const SCHEMA_NAME = 'org.gnome.shell.extensions.notification-banner-reloaded'; const SCHEMA_NAME = 'org.gnome.shell.extensions.notification-banner-reloaded';
const getSchema = function () { var SettingsSchema = ExtensionUtils.getSettings(SCHEMA_NAME);
let schemaDir = Me.dir.get_child('schemas').get_path();
let schemaSource = Gio.SettingsSchemaSource.new_from_directory(schemaDir, Gio.SettingsSchemaSource.get_default(), false);
let schema = schemaSource.lookup(SCHEMA_NAME, false);
return new Gio.Settings({ settings_schema: schema });
};
var SettingsSchema = getSchema();
function init() { function init() {
let localeDir = Me.dir.get_child('locale'); let localeDir = Me.dir.get_child('locale');