use crate::{
elements::{Element, NavigationRailDestinationElement},
foundation::{Id, Key, WidgetProperties},
painting::{EdgeInsetsGeometry, NoneEdgeInsetsGeometry},
widgets::{NoneWidget, Widget},
};
pub struct NavigationRailDestination {
pub key: Key,
pub icon: Box<dyn Widget>,
pub selected_icon: Box<dyn Widget>,
pub label: Box<dyn Widget>,
pub padding: Box<dyn EdgeInsetsGeometry>,
}
impl Default for NavigationRailDestination {
fn default() -> Self {
Self {
key: Default::default(),
icon: box NoneWidget,
selected_icon: box NoneWidget,
label: box NoneWidget,
padding: box NoneEdgeInsetsGeometry,
}
}
}
impl Widget for NavigationRailDestination {
fn create_element(&self) -> Box<dyn Element> {
box NavigationRailDestinationElement::new(self)
}
}
impl WidgetProperties for NavigationRailDestination {
fn key(&self) -> &Key {
&self.key
}
fn x(&self) -> f32 {
0.0
}
fn y(&self) -> f32 {
0.0
}
fn w(&self) -> f32 {
0.0
}
fn h(&self) -> f32 {
0.0
}
fn w_min(&self) -> f32 {
0.0
}
fn h_min(&self) -> f32 {
0.0
}
fn w_max(&self) -> f32 {
0.0
}
fn h_max(&self) -> f32 {
0.0
}
fn parent(&self) -> Option<Id> {
None
}
fn depth(&self) -> f32 {
0.0
}
fn visible(&self) -> bool {
true
}
fn mouse_input(&self) -> bool {
true
}
fn key_input(&self) -> bool {
true
}
fn renderable(&self) -> bool {
true
}
fn internal_visible(&self) -> bool {
true
}
}