use iced::{Length, Task, alignment::Horizontal, widget::Column}; use tracing::info; use crate::ui::main_window::{MainWindowMsg, TabContent}; #[derive(Default)] pub struct PartViewer {} #[derive(Debug, PartialEq, Eq, Clone)] pub enum PartViewerMsg { Nothing, } impl TabContent for PartViewer { type TabMessage = PartViewerMsg; fn update(&mut self, msg: Self::TabMessage) -> Task { match msg { PartViewerMsg::Nothing => { info!("This function not allowed."); } } Task::none() } fn content(&self) -> iced::Element<'_, MainWindowMsg> { let btn = iced::widget::button("PartViewer") .on_press(MainWindowMsg::PartViewer(PartViewerMsg::Nothing)); Column::new() .align_x(Horizontal::Left) .width(Length::Fill) .height(Length::Fill) .push(btn) .into() } }