Commit dde3dd91 authored by Alex Fandrianto's avatar Alex Fandrianto

This makes it easier for apps to control whether an IgnorePointer

widget is actively ignoring or not by changing a boolean instead of
the tree structure. ignoring defaults to true.
parent bc169671
......@@ -671,8 +671,10 @@ class RenderCustomPaint extends RenderProxyBox {
}
class RenderIgnorePointer extends RenderProxyBox {
RenderIgnorePointer({ RenderBox child }) : super(child);
RenderIgnorePointer({ RenderBox child, bool ignoring: true }) : super(child);
bool ignoring;
bool hitTest(HitTestResult result, { Point position }) {
return false;
return ignoring ? false : super.hitTest(result, position: position);
}
}
......@@ -899,8 +899,15 @@ class WidgetToRenderBoxAdapter extends LeafRenderObjectWrapper {
// EVENT HANDLING
class IgnorePointer extends OneChildRenderObjectWrapper {
IgnorePointer({ Key key, Widget child })
IgnorePointer({ Key key, Widget child, this.ignoring })
: super(key: key, child: child);
RenderIgnorePointer createNode() => new RenderIgnorePointer();
final bool ignoring;
RenderIgnorePointer createNode() => new RenderIgnorePointer(ignoring: ignoring);
RenderIgnorePointer get renderObject => super.renderObject;
void syncRenderObject(Widget old) {
super.syncRenderObject(old);
renderObject.ignoring = ignoring;
}
}
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