feat(ags cursorbox): allow passing extra onHover stuff to it
This commit is contained in:
parent
1fedeb186b
commit
898060e0f3
1 changed files with 6 additions and 0 deletions
|
@ -7,6 +7,8 @@ const display = Gdk.Display.get_default();
|
|||
export default ({
|
||||
isButton = false,
|
||||
reset = true,
|
||||
onHover = () => {},
|
||||
onHoverLost = () => {},
|
||||
...props
|
||||
}) => {
|
||||
if (!isButton) {
|
||||
|
@ -18,10 +20,14 @@ export default ({
|
|||
|
||||
else
|
||||
self.window.set_cursor(Gdk.Cursor.new_from_name(display, 'pointer'));
|
||||
|
||||
onHover(self);
|
||||
},
|
||||
onHoverLost: self => {
|
||||
if (reset)
|
||||
self.window.set_cursor(null);
|
||||
|
||||
onHoverLost(self);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue