use crate::{
environment::LayoutEnvironment,
layout::{Layout, ResolvedLayout},
primitives::ProposedDimensions,
render::Renderable,
};
#[derive(Debug, Clone)]
pub struct Hidden<T> {
child: T,
}
impl<T> Hidden<T> {
pub const fn new(child: T) -> Self {
Self { child }
}
}
impl<T: Layout> Layout for Hidden<T> {
type Sublayout = T::Sublayout;
fn layout(
&self,
offer: &ProposedDimensions,
env: &impl LayoutEnvironment,
) -> ResolvedLayout<Self::Sublayout> {
self.child.layout(offer, env)
}
fn priority(&self) -> i8 {
self.child.priority()
}
fn is_empty(&self) -> bool {
self.child.is_empty()
}
}
impl<T: Renderable> Renderable for Hidden<T> {
type Renderables = ();
fn render_tree(
&self,
_layout: &ResolvedLayout<Self::Sublayout>,
_origin: crate::primitives::Point,
_env: &impl LayoutEnvironment,
) -> Self::Renderables {
}
}