a little polishing
This commit is contained in:
+19
-1
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user