gesture,widget: add hovered property

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2021-01-14 19:27:20 +02:00
committed by Elias Naur
parent 99bfa6a33c
commit 93ebd51531
3 changed files with 30 additions and 0 deletions
+10
View File
@@ -58,6 +58,16 @@ func (b *Clickable) Clicked() bool {
return true
}
// Hovered returns whether pointer is over the element.
func (b *Clickable) Hovered() bool {
return b.click.Hovered()
}
// Pressed returns whether pointer is pressing the element.
func (b *Clickable) Pressed() bool {
return b.click.Pressed()
}
// Clicks returns and clear the clicks since the last call to Clicks.
func (b *Clickable) Clicks() []Click {
clicks := b.clicks