🔧 Add close-effects menu

This commit is contained in:
Simon Schneegans
2022-01-09 13:05:34 +01:00
parent e3f0288eaf
commit 7ec9609d7a
7 changed files with 116 additions and 97 deletions
+14 -10
View File
@@ -25,6 +25,20 @@ const PrefsPage = Me.imports.src.prefs.PrefsPage.PrefsPage;
var FirePage = class FirePage extends PrefsPage {
// ---------------------------------------------------------------------- static methods
static getMinShellVersion() {
return [3, 36];
}
static getSettingsPrefix() {
return 'fire';
}
static getLabel() {
return 'Fire';
}
// ------------------------------------------------------------ constructor / destructor
constructor(settings, builder) {
@@ -60,16 +74,6 @@ var FirePage = class FirePage extends PrefsPage {
stack.add_titled(this._builder.get_object('fire-prefs'), 'fire', 'Fire');
}
// ---------------------------------------------------------------------- public methods
getEnabledKey() {
return 'fire-close-effect';
}
getAnimationTime() {
return this._settings.get_int('fire-animation-time');
}
// ----------------------------------------------------------------------- private stuff
// This populates the preset dropdown menu for the fire options.
+14 -14
View File
@@ -23,15 +23,25 @@ const PrefsPage = Me.imports.src.prefs.PrefsPage.PrefsPage;
var MatrixPage = class MatrixPage extends PrefsPage {
// ---------------------------------------------------------------------- static methods
static getMinShellVersion() {
return [40, 0];
}
static getSettingsPrefix() {
return 'matrix';
}
static getLabel() {
return 'Matrix';
}
// ------------------------------------------------------------ constructor / destructor
constructor(settings, builder) {
super(settings, builder);
if (!utils.shellVersionIsAtLeast(40, 0)) {
return;
}
this._builder.add_from_resource('/ui/gtk4/matrixPage.ui');
// Bind all properties.
@@ -44,14 +54,4 @@ var MatrixPage = class MatrixPage extends PrefsPage {
const stack = this._builder.get_object('main-stack');
stack.add_titled(this._builder.get_object('matrix-prefs'), 'matrix', 'Matrix');
}
// ---------------------------------------------------------------------- public methods
getEnabledKey() {
return 'matrix-close-effect';
}
getAnimationTime() {
return this._settings.get_int('matrix-animation-time');
}
}
+14 -14
View File
@@ -23,15 +23,25 @@ const PrefsPage = Me.imports.src.prefs.PrefsPage.PrefsPage;
var TRexPage = class TRexPage extends PrefsPage {
// ---------------------------------------------------------------------- static methods
static getMinShellVersion() {
return [40, 0];
}
static getSettingsPrefix() {
return 'trex';
}
static getLabel() {
return 'T-Rex Attack';
}
// ------------------------------------------------------------ constructor / destructor
constructor(settings, builder) {
super(settings, builder);
if (!utils.shellVersionIsAtLeast(40, 0)) {
return;
}
this._builder.add_from_resource('/ui/gtk4/trexPage.ui');
// Bind all properties.
@@ -44,14 +54,4 @@ var TRexPage = class TRexPage extends PrefsPage {
const stack = this._builder.get_object('main-stack');
stack.add_titled(this._builder.get_object('trex-prefs'), 'trex', 'T-Rex Attack');
}
// ---------------------------------------------------------------------- public methods
getEnabledKey() {
return 'trex-close-effect';
}
getAnimationTime() {
return this._settings.get_int('trex-animation-time');
}
}
+14 -10
View File
@@ -23,6 +23,20 @@ const PrefsPage = Me.imports.src.prefs.PrefsPage.PrefsPage;
var TVEffectPage = class TVEffectPage extends PrefsPage {
// ---------------------------------------------------------------------- static methods
static getMinShellVersion() {
return [3, 36];
}
static getSettingsPrefix() {
return 'tv';
}
static getLabel() {
return 'TV Effect';
}
// ------------------------------------------------------------ constructor / destructor
constructor(settings, builder) {
@@ -37,14 +51,4 @@ var TVEffectPage = class TVEffectPage extends PrefsPage {
const stack = this._builder.get_object('main-stack');
stack.add_titled(this._builder.get_object('tv-prefs'), 'tv', 'TV Effect');
}
// ---------------------------------------------------------------------- public methods
getEnabledKey() {
return 'tv-close-effect';
}
getAnimationTime() {
return this._settings.get_int('tv-animation-time');
}
}