Use Time enumeration

This commit is contained in:
Romain Vigier
2021-08-26 11:05:10 +02:00
parent 21362c9652
commit c0d1f13022
17 changed files with 153 additions and 95 deletions
+8 -4
View File
@@ -10,6 +10,8 @@ const Me = extensionUtils.getCurrentExtension();
const e = Me.imports.extension;
const utils = Me.imports.utils;
const { Time } = Me.imports.enums.Time;
/**
* The Icon Themer is responsible for changing the icon theme according to the
@@ -120,12 +122,14 @@ var IconThemer = class {
_updateCurrentVariant() {
if (e.timer.time)
this._iconVariantsSettings.set_string(e.timer.time, this._interfaceSettings.get_string('icon-theme'));
if (e.timer.time === Time.UNKNOWN)
return;
this._iconVariantsSettings.set_string(e.timer.time, this._interfaceSettings.get_string('icon-theme'));
}
_updateSystemIconTheme() {
if (e.timer.time && this._iconVariantsSettings.get_string(e.timer.time))
this._interfaceSettings.set_string('icon-theme', this._iconVariantsSettings.get_string(e.timer.time));
if (e.timer.time === Time.UNKNOWN || !this._iconVariantsSettings.get_string(e.timer.time))
return;
this._interfaceSettings.set_string('icon-theme', this._iconVariantsSettings.get_string(e.timer.time));
}
};