2023-12-08 02:22:38 -05:00
|
|
|
import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
|
2023-12-07 15:28:58 -05:00
|
|
|
|
|
|
|
import Variable from 'resource:///com/github/Aylur/ags/variable.js';
|
|
|
|
|
2023-11-16 00:48:50 -05:00
|
|
|
import EventBox from '../../misc/cursorbox.js';
|
2023-12-07 16:48:34 -05:00
|
|
|
import Persist from '../../misc/persist.js';
|
2023-09-04 22:27:34 -04:00
|
|
|
|
2023-12-07 16:48:34 -05:00
|
|
|
const HeartState = Variable();
|
2023-10-17 13:47:02 -04:00
|
|
|
|
2023-12-07 16:48:34 -05:00
|
|
|
Persist({
|
|
|
|
name: 'heart',
|
|
|
|
gobject: HeartState,
|
|
|
|
prop: 'value',
|
|
|
|
condition: '',
|
|
|
|
whenFalse: '',
|
2023-12-07 15:28:58 -05:00
|
|
|
});
|
2023-10-17 13:47:02 -04:00
|
|
|
|
2023-09-04 22:27:34 -04:00
|
|
|
|
2023-12-08 02:22:38 -05:00
|
|
|
export default () => EventBox({
|
|
|
|
onPrimaryClickRelease: () => {
|
|
|
|
HeartState.value = HeartState.value === '' ? '' : '';
|
|
|
|
},
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-12-08 02:22:38 -05:00
|
|
|
child: Label({
|
|
|
|
className: 'heart-toggle',
|
|
|
|
binds: [['label', HeartState, 'value']],
|
|
|
|
}),
|
|
|
|
});
|