feat(ags): make cursor blocked when button is disabled
This commit is contained in:
parent
c97ebf6c51
commit
943e834af5
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue