forked from max_ag/wayland_panel
refactor + broken battery
This commit is contained in:
parent
58166358ba
commit
93857e2f18
15 changed files with 598 additions and 2440 deletions
25
src/widgets/spacer.rs
Normal file
25
src/widgets/spacer.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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, _id: iced::window::Id) -> iced::Element<'_, crate::widget::Message> {
|
||||
iced::widget::space().width(self.space).into()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue