Skip to content

Commit

Permalink
chore: rust fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sundaram123krishnan committed Nov 15, 2024
1 parent 8d29339 commit 58f903d
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion lala_bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn main() -> Result<(), iced_layershell::Error> {
.with_default_directive(LevelFilter::INFO.into())
.from_env_lossy()
.add_directive("usvg=off".parse().unwrap()), //.parse("usvg::parser::svgtree=off")
//.unwrap(),
//.unwrap(),
)
.init();
LalaMusicBar::run(Settings {
Expand Down
64 changes: 32 additions & 32 deletions lala_bar/src/music_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct LalaMusicBar {
bar_index: SliderIndex,
launcher: Option<launcher::Launcher>,
launcherid: Option<iced::window::Id>,
hiddenid: Option<iced::window::Id>,
hiddenid: Option<icded::window::Id>,
hiddenid_lock: bool,
right_panel: Option<iced::window::Id>,
notifications: HashMap<u32, NotifyUnitWidgetInfo>,
Expand Down Expand Up @@ -67,9 +67,9 @@ impl LalaMusicBar {
Space::with_width(5.),
text(dateday)
])
.center_y(Length::Fill)
.height(Length::Fill)
.into()
.center_y(Length::Fill)
.height(Length::Fill)
.into()
}
pub fn update_hidden_notification(&mut self) {
let mut hiddened: Vec<NotifyUnitWidgetInfo> = self
Expand Down Expand Up @@ -222,8 +222,8 @@ impl LalaMusicBar {
Space::with_width(Length::Fixed(1.)),
button(">").on_press(Message::SliderIndexNext)
]
.align_y(Alignment::Center)
.into()
.align_y(Alignment::Center)
.into()
}
fn left_bar(&self) -> Element<Message> {
row![
Expand All @@ -235,8 +235,8 @@ impl LalaMusicBar {
Space::with_width(Length::Fixed(10.)),
button(">").on_press(Message::SliderIndexNext)
]
.align_y(Alignment::Center)
.into()
.align_y(Alignment::Center)
.into()
}
fn right_bar(&self) -> Element<Message> {
row![
Expand All @@ -248,8 +248,8 @@ impl LalaMusicBar {
Space::with_width(Length::Fixed(10.)),
button(">").on_press(Message::SliderIndexNext)
]
.align_y(Alignment::Center)
.into()
.align_y(Alignment::Center)
.into()
}

fn sound_slider(&self) -> Element<Message> {
Expand Down Expand Up @@ -304,9 +304,9 @@ impl LalaMusicBar {
color: Some(iced::Color::WHITE),
}),
)
.width(Length::Fill)
.center_x(Length::Fill)
.into(),
.width(Length::Fill)
.center_x(Length::Fill)
.into(),
);
view_elements.push(Space::with_height(10.).into());
}
Expand All @@ -318,8 +318,8 @@ impl LalaMusicBar {
column(btns).spacing(10.),
Space::with_width(10.)
))
.height(Length::Fill)
.into(),
.height(Length::Fill)
.into(),
container(checkbox("quite mode", self.quite_mode).on_toggle(Message::QuiteMode))
.width(Length::Fill)
.center_x(Length::Fill)
Expand All @@ -342,7 +342,7 @@ impl LalaMusicBar {
.width(25.)
.height(25.),
)
.on_press(Message::ToggleLauncher);
.on_press(Message::ToggleLauncher);

let sound_slider = self.sound_slider();
let panel_text = if self.right_panel.is_some() { ">" } else { "<" };
Expand All @@ -357,7 +357,7 @@ impl LalaMusicBar {
Space::with_width(Length::Fixed(3.)),
button(text(panel_text)).on_press(Message::ToggleRightPanel)
]
.spacing(10);
.spacing(10);
return container(col)
.width(Length::Fill)
.height(Length::Fill)
Expand Down Expand Up @@ -392,8 +392,8 @@ impl LalaMusicBar {
color: Some(iced::Color::WHITE),
}),
)
.width(Length::Fill)
.center_x(Length::Fill);
.width(Length::Fill)
.center_x(Length::Fill);
let can_play = service_data.can_play;
let can_pause = service_data.can_pause;
let can_go_next = service_data.can_go_next;
Expand Down Expand Up @@ -445,7 +445,7 @@ impl LalaMusicBar {
Space::with_width(Length::Fixed(3.)),
button(text(panel_text)).on_press(Message::ToggleRightPanel)
]
.spacing(10)
.spacing(10)
} else {
row![
toggle_launcher,
Expand All @@ -458,7 +458,7 @@ impl LalaMusicBar {
Space::with_width(Length::Fixed(3.)),
button(text(panel_text)).on_press(Message::ToggleRightPanel)
]
.spacing(10)
.spacing(10)
};

container(col)
Expand Down Expand Up @@ -565,8 +565,8 @@ impl MultiApplication for LalaMusicBar {
'clear_nid: {
if let Some(nid) = self.showned_notifications.remove(&id) {
if let Some(NotifyUnitWidgetInfo {
to_delete: false, ..
}) = self.notifications.get(&nid)
to_delete: false, ..
}) = self.notifications.get(&nid)
{
break 'clear_nid;
}
Expand Down Expand Up @@ -1021,7 +1021,7 @@ impl MultiApplication for LalaMusicBar {
))),
]
]
.into();
.into();
}
return btnwidgets;
}
Expand All @@ -1030,7 +1030,7 @@ impl MultiApplication for LalaMusicBar {
"hidden notifications {}",
self.hidden_notification().len()
))
.into();
.into();
}
LaLaInfo::RightPanel => {
return self.right_panel_view();
Expand Down Expand Up @@ -1092,7 +1092,7 @@ impl MultiApplication for LalaMusicBar {
spec_version: env!("CARGO_PKG_VERSION_PATCH").to_owned(),
},
)
.await
.await
else {
pending::<()>().await;
unreachable!()
Expand All @@ -1115,26 +1115,26 @@ impl MultiApplication for LalaMusicBar {
id,
&action_key,
)
.await
.ok();
.await
.ok();
}
NotifyCommand::InlineReply { id, text } => {
LaLaMakoMusic::notification_replied(
lalaref.signal_emitter(),
id,
&text,
)
.await
.ok();
.await
.ok();
}
NotifyCommand::NotificationClosed { id, reason } => {
LaLaMakoMusic::notification_closed(
lalaref.signal_emitter(),
id,
reason,
)
.await
.ok();
.await
.ok();
}
}
}
Expand Down
50 changes: 25 additions & 25 deletions lala_bar/src/notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl NotifyUnitWidgetInfo {
markdown::Settings::default(),
markdown::Style::from_palette(bar.theme().palette()),
)
.map(Message::LinkClicked),
.map(Message::LinkClicked),
None => text(notify.body.clone())
.shaping(text::Shaping::Advanced)
.into(),
Expand Down Expand Up @@ -69,16 +69,16 @@ impl NotifyUnitWidgetInfo {
text_render
]
])
.style(notify_theme)
.width(Length::Fill)
.height(Length::Fill)
.on_press(Message::RemoveNotify(self.unit.id))
.into(),
.style(notify_theme)
.width(Length::Fill)
.height(Length::Fill)
.on_press(Message::RemoveNotify(self.unit.id))
.into(),
Some(ImageInfo::Data {
pixels,
width,
height,
}) => button(row![
pixels,
width,
height,
}) => button(row![
image(image::Handle::from_rgba(
width as u32,
height as u32,
Expand All @@ -96,11 +96,11 @@ impl NotifyUnitWidgetInfo {
text_render
]
])
.width(Length::Fill)
.height(Length::Fill)
.style(notify_theme)
.on_press(Message::RemoveNotify(self.unit.id))
.into(),
.width(Length::Fill)
.height(Length::Fill)
.style(notify_theme)
.on_press(Message::RemoveNotify(self.unit.id))
.into(),
Some(ImageInfo::Png(path)) | Some(ImageInfo::Jpg(path)) => button(row![
image(image::Handle::from_path(path)).height(Length::Fill),
Space::with_width(4.),
Expand All @@ -115,20 +115,20 @@ impl NotifyUnitWidgetInfo {
text_render
]
])
.width(Length::Fill)
.height(Length::Fill)
.style(button::secondary)
.on_press(Message::RemoveNotify(self.unit.id))
.into(),
.width(Length::Fill)
.height(Length::Fill)
.style(button::secondary)
.on_press(Message::RemoveNotify(self.unit.id))
.into(),
_ => button(column![
text(notify.summery.clone()).shaping(text::Shaping::Advanced),
text_render
])
.width(Length::Fill)
.height(Length::Fill)
.style(notify_theme)
.on_press(Message::RemoveNotify(self.unit.id))
.into(),
.width(Length::Fill)
.height(Length::Fill)
.style(notify_theme)
.on_press(Message::RemoveNotify(self.unit.id))
.into(),
}
}
}
Expand Down

0 comments on commit 58f903d

Please sign in to comment.