🔧 Implicitely load effect preferences

This commit is contained in:
Simon Schneegans
2023-01-25 05:50:46 +01:00
parent b2f5a930d0
commit 6bdb1b07ff
79 changed files with 141 additions and 299 deletions
+3 -11
View File
@@ -116,23 +116,15 @@ var Matrix = class {
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getUIDir()}/Matrix.ui`);
// Bind all properties.
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
dialog.bindAdjustment('matrix-animation-time');
dialog.bindAdjustment('matrix-scale');
dialog.bindAdjustment('matrix-randomness');
dialog.bindAdjustment('matrix-overshoot');
dialog.bindColorButton('matrix-trail-color');
dialog.bindColorButton('matrix-tip-color');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('matrix-prefs');
}
// ---------------------------------------------------------------- API for extension.js