25 lines
594 B
Rust
25 lines
594 B
Rust
use crate::widget::PanelWidget;
|
|
|
|
pub struct Spacer {
|
|
space: iced::Length,
|
|
}
|
|
|
|
impl Spacer {
|
|
pub fn new(space: iced::Length) -> Self {
|
|
Self { space }
|
|
}
|
|
}
|
|
|
|
impl PanelWidget for Spacer {
|
|
fn update(&mut self, _message: &crate::widget::Message) -> iced::Task<crate::widget::Message> {
|
|
iced::Task::none()
|
|
}
|
|
|
|
fn subscribe(&self) -> iced::Subscription<crate::widget::Message> {
|
|
iced::Subscription::none()
|
|
}
|
|
|
|
fn view(&self) -> Option<iced::Element<'_, crate::widget::Message>> {
|
|
Some(iced::widget::space().width(self.space).into())
|
|
}
|
|
}
|