feat(ags): make cursor blocked when button is disabled

This commit is contained in:
matt1432 2023-09-11 15:55:16 -04:00
parent c97ebf6c51
commit 943e834af5

View file

@ -22,7 +22,12 @@ const display = Gdk.Display.get_default();
export const EventBox = ({ ...params }) => ags.Widget.EventBox({ export const EventBox = ({ ...params }) => ags.Widget.EventBox({
...params, ...params,
onHover: box => { onHover: box => {
if (! box.child.sensitive || ! box.sensitive) {
box.window.set_cursor(Gdk.Cursor.new_from_name(display, 'not-allowed'));
}
else {
box.window.set_cursor(Gdk.Cursor.new_from_name(display, 'pointer')); box.window.set_cursor(Gdk.Cursor.new_from_name(display, 'pointer'));
}
}, },
onHoverLost: box => { onHoverLost: box => {
box.window.set_cursor(null); box.window.set_cursor(null);