forked from Shinonome/dots-hyprland
ags: update to new syntax
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
const { Gdk, Gtk } = imports.gi;
|
||||
import { App, Service, Utils, Variable, Widget } from '../imports.js';
|
||||
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
|
||||
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
|
||||
import { MaterialIcon } from './materialicon.js';
|
||||
import { setupCursorHover } from './cursorhover.js';
|
||||
const { Box, Button, Entry, EventBox, Icon, Label, Revealer, Scrollable, Stack } = Widget;
|
||||
const { Box, Button, Label, Revealer } = Widget;
|
||||
|
||||
export const ConfigToggle = ({ icon, name, desc = '', initValue, onChange, ...rest }) => {
|
||||
let value = initValue;
|
||||
@@ -37,8 +37,8 @@ export const ConfigToggle = ({ icon, name, desc = '', initValue, onChange, ...re
|
||||
]
|
||||
});
|
||||
const interactionWrapper = Button({
|
||||
properties: [
|
||||
['toggle', (newValue) => {
|
||||
attribute: {
|
||||
toggle: (newValue) => {
|
||||
value = !value;
|
||||
toggleIcon.toggleClassName('switch-fg-toggling-false', false);
|
||||
if (!value) {
|
||||
@@ -52,10 +52,10 @@ export const ConfigToggle = ({ icon, name, desc = '', initValue, onChange, ...re
|
||||
toggleIcon.toggleClassName('txt-poof', false);
|
||||
})
|
||||
onChange(interactionWrapper, value);
|
||||
}]
|
||||
],
|
||||
}
|
||||
},
|
||||
child: widgetContent,
|
||||
onClicked: (self) => self._toggle(self),
|
||||
onClicked: (self) => self.attribute.toggle(self),
|
||||
setup: (button) => {
|
||||
setupCursorHover(button),
|
||||
button.connect('pressed', () => { // mouse down
|
||||
|
||||
Reference in New Issue
Block a user