use super::{Widget, Children, PaintCtx};
pub struct IgnorePointer<W: Widget> { child: W }
impl<W: Widget + Send + Sync + 'static> IgnorePointer<W> {
pub fn new(child: W) -> Self { Self { child } }
}
impl<W: Widget + Send + Sync + 'static> Widget for IgnorePointer<W> {
fn children(&self) -> Children<'_> { Children::One(&self.child) }
fn paint(&self, ctx: &mut PaintCtx) {
ctx.set_pointer_mode(1); let r = ctx.rect;
self.child.paint(&mut ctx.child(r));
}
}
pub struct AbsorbPointer<W: Widget> { child: W }
impl<W: Widget + Send + Sync + 'static> AbsorbPointer<W> {
pub fn new(child: W) -> Self { Self { child } }
}
impl<W: Widget + Send + Sync + 'static> Widget for AbsorbPointer<W> {
fn children(&self) -> Children<'_> { Children::One(&self.child) }
fn paint(&self, ctx: &mut PaintCtx) {
ctx.set_pointer_mode(2); let r = ctx.rect;
self.child.paint(&mut ctx.child(r));
}
}