mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
ui/pointer: simplify pointer pass through
Get rid of the confused LayerOp and the transparent property from AreaOp. Add an explicit PassOp to specify whether pointer events pass-through the current area. Let AreaOp swallow events even when no handlers are active for the area. That behaviour is less surprising and allow clients to disable a widget by keeping its areas but leave out its handlers. Simplify the pointer.HitResult enum to just a bool: hit or no hit. Finally, simplify the pointer queue by tracking parent areas and node with indices.
This commit is contained in:
@@ -16,6 +16,7 @@ const (
|
||||
TypeColor
|
||||
TypeArea
|
||||
TypePointerHandler
|
||||
TypePass
|
||||
TypeKeyHandler
|
||||
TypeHideInput
|
||||
TypePush
|
||||
@@ -35,6 +36,7 @@ const (
|
||||
TypeColorLen = 1 + 4
|
||||
TypeAreaLen = 1 + 1 + 2*4
|
||||
TypePointerHandlerLen = 1 + 1
|
||||
TypePassLen = 1 + 1
|
||||
TypeKeyHandlerLen = 1 + 1
|
||||
TypeHideInputLen = 1
|
||||
TypePushLen = 1
|
||||
@@ -55,6 +57,7 @@ func (t OpType) Size() int {
|
||||
TypeColorLen,
|
||||
TypeAreaLen,
|
||||
TypePointerHandlerLen,
|
||||
TypePassLen,
|
||||
TypeKeyHandlerLen,
|
||||
TypeHideInputLen,
|
||||
TypePushLen,
|
||||
|
||||
Reference in New Issue
Block a user