Commit c78e81f5 authored by Ian Hickson's avatar Ian Hickson

More detailed debugging info for RenderPointerListener et al

Elaborate on the debugging information exposed by
RenderPointerListener, Listener, and GestureDetector.
parent 4e329a67
......@@ -1038,8 +1038,17 @@ class RenderPointerListener extends RenderProxyBox {
if (listeners.isEmpty)
listeners.add('<none>');
settings.add('listeners: ${listeners.join(", ")}');
if (behavior != HitTestBehavior.deferToChild)
settings.add('behavior: $behavior');
switch (behavior) {
case HitTestBehavior.translucent:
settings.add('behavior: translucent');
break;
case HitTestBehavior.opaque:
settings.add('behavior: opaque');
break;
case HitTestBehavior.deferToChild:
settings.add('behavior: defer-to-child');
break;
}
}
}
......
......@@ -1258,6 +1258,33 @@ class Listener extends OneChildRenderObjectWidget {
renderObject.onPointerCancel = onPointerCancel;
renderObject.behavior = behavior;
}
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
List<String> listeners = <String>[];
if (onPointerDown != null)
listeners.add('down');
if (onPointerMove != null)
listeners.add('move');
if (onPointerUp != null)
listeners.add('up');
if (onPointerCancel != null)
listeners.add('cancel');
if (listeners.isEmpty)
listeners.add('<none>');
description.add('listeners: ${listeners.join(", ")}');
switch (behavior) {
case HitTestBehavior.translucent:
description.add('behavior: translucent');
break;
case HitTestBehavior.opaque:
description.add('behavior: opaque');
break;
case HitTestBehavior.deferToChild:
description.add('behavior: defer-to-child');
break;
}
}
}
class IgnorePointer extends OneChildRenderObjectWidget {
......
......@@ -259,5 +259,16 @@ class _GestureDetectorState extends State<GestureDetector> {
if (gestures.isEmpty)
gestures.add('<none>');
description.add('gestures: ${gestures.join(", ")}');
switch (config.behavior) {
case HitTestBehavior.translucent:
description.add('behavior: translucent');
break;
case HitTestBehavior.opaque:
description.add('behavior: opaque');
break;
case HitTestBehavior.deferToChild:
description.add('behavior: defer-to-child');
break;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment