a little polishing

This commit is contained in:
Justin Garza
2024-12-17 20:34:49 -05:00
parent 002e7258f6
commit 020516e0da
5 changed files with 63 additions and 22 deletions
+19 -1
View File
@@ -151,6 +151,24 @@ export default class Effect {
.set_sensitive(!state);
}
const randColor = dialog.getBuilder().get_object('aura-glow-random-color');
if (randColor) {
// Connect to the "toggled" signal to update preferences dynamically
randColor.connect('toggled', (widget) => {
const state = widget.get_active(); // Retrieve the state directly
EnableDisablePref(dialog, state); // Update sensitivity when the state changes
});
// Manually call the update function on startup, using the initial state of the switch
const initialState = randColor.get_active(); // Get the initial state of the check button
EnableDisablePref(dialog, initialState);
} else {
// Log an error if the switch widget is not found in the UI
log('Error: \'aura-glow-random-color\' switch widget not found.');
}
//if we use a switch instead of a checkbox
/*
const switchWidget = dialog.getBuilder().get_object('aura-glow-random-color');
if (switchWidget) {
// Connect to the "state-set" signal to update preferences dynamically based on
@@ -168,7 +186,7 @@ export default class Effect {
// Log an error if the switch widget is not found in the UI.
log('Error: \'aura-glow-random-color\' switch widget not found.');
}
*/
// Retrieve the necessary objects
const colorOffset = dialog.getBuilder().get_object('aura-glow-color-offset-scale');