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({
...params,
onHover: box => {
box.window.set_cursor(Gdk.Cursor.new_from_name(display, 'pointer'));
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'));
}
},
onHoverLost: box => {
box.window.set_cursor(null);