Remove EventDisposition

All the use cases for EventDisposition are now addressed by the gesture
detection system.
This commit is contained in:
Adam Barth
2015-09-21 16:41:54 -07:00
parent 1976ae1d5e
commit 051354ae1d
33 changed files with 74 additions and 170 deletions

View File

@@ -528,15 +528,11 @@ class RenderSolidColor extends RenderDecoratedSector {
deltaTheta = constraints.constrainDeltaTheta(desiredDeltaTheta);
}
EventDisposition handleEvent(sky.Event event, HitTestEntry entry) {
if (event.type == 'pointerdown') {
void handleEvent(sky.Event event, HitTestEntry entry) {
if (event.type == 'pointerdown')
decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
return EventDisposition.processed;
} else if (event.type == 'pointerup') {
else if (event.type == 'pointerup')
decoration = new BoxDecoration(backgroundColor: backgroundColor);
return EventDisposition.processed;
}
return EventDisposition.ignored;
}
}

View File

@@ -42,14 +42,10 @@ class RenderSolidColorBox extends RenderDecoratedBox {
size = constraints.constrain(desiredSize);
}
EventDisposition handleEvent(sky.Event event, BoxHitTestEntry entry) {
if (event.type == 'pointerdown') {
void handleEvent(sky.Event event, BoxHitTestEntry entry) {
if (event.type == 'pointerdown')
decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
return EventDisposition.processed;
} else if (event.type == 'pointerup') {
else if (event.type == 'pointerup')
decoration = new BoxDecoration(backgroundColor: backgroundColor);
return EventDisposition.processed;
}
return EventDisposition.ignored;
}
}

View File

@@ -39,7 +39,7 @@ class RenderTouchDemo extends RenderBox {
RenderTouchDemo();
EventDisposition handleEvent(sky.Event event, BoxHitTestEntry entry) {
void handleEvent(sky.Event event, BoxHitTestEntry entry) {
if (event is sky.PointerEvent) {
switch (event.type) {
case 'pointerdown':
@@ -57,9 +57,7 @@ class RenderTouchDemo extends RenderBox {
break;
}
markNeedsPaint();
return EventDisposition.processed;
}
return EventDisposition.processed;
}
void performLayout() {