style: apply rustfmt across workspace
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use iced::{
|
||||
Border, Color, Element, Length, Size, Subscription, Task,
|
||||
event,
|
||||
Border, Color, Element, Length, Size, Subscription, Task, event,
|
||||
keyboard::{Event as KeyEvent, Key, key::Named},
|
||||
widget::{column, container, image, row, scrollable, svg, text, text_input, Space},
|
||||
widget::{Space, column, container, image, row, scrollable, svg, text, text_input},
|
||||
window,
|
||||
};
|
||||
|
||||
@@ -126,8 +125,13 @@ fn view(state: &KLauncherApp) -> Element<'_, Message> {
|
||||
.padding(12)
|
||||
.size(cfg.search_font_size)
|
||||
.style(|theme, _status| {
|
||||
let mut s = iced::widget::text_input::default(theme, iced::widget::text_input::Status::Active);
|
||||
s.border = Border { color: Color::TRANSPARENT, width: 0.0, radius: 0.0.into() };
|
||||
let mut s =
|
||||
iced::widget::text_input::default(theme, iced::widget::text_input::Status::Active);
|
||||
s.border = Border {
|
||||
color: Color::TRANSPARENT,
|
||||
width: 0.0,
|
||||
radius: 0.0.into(),
|
||||
};
|
||||
s
|
||||
});
|
||||
|
||||
@@ -147,26 +151,27 @@ fn view(state: &KLauncherApp) -> Element<'_, Message> {
|
||||
Color::from_rgba8(255, 255, 255, 0.07)
|
||||
};
|
||||
let icon_el: Element<'_, Message> = match &result.icon {
|
||||
Some(p) if p.ends_with(".svg") =>
|
||||
svg(svg::Handle::from_path(p)).width(24).height(24).into(),
|
||||
Some(p) =>
|
||||
image(image::Handle::from_path(p)).width(24).height(24).into(),
|
||||
Some(p) if p.ends_with(".svg") => {
|
||||
svg(svg::Handle::from_path(p)).width(24).height(24).into()
|
||||
}
|
||||
Some(p) => image(image::Handle::from_path(p))
|
||||
.width(24)
|
||||
.height(24)
|
||||
.into(),
|
||||
None => Space::new().width(24).height(24).into(),
|
||||
};
|
||||
let title_col: Element<'_, Message> = if let Some(desc) = &result.description {
|
||||
column![
|
||||
text(result.title.as_str()).size(title_size),
|
||||
text(desc).size(desc_size).color(Color::from_rgba8(210, 215, 230, 1.0)),
|
||||
text(desc)
|
||||
.size(desc_size)
|
||||
.color(Color::from_rgba8(210, 215, 230, 1.0)),
|
||||
]
|
||||
.into()
|
||||
} else {
|
||||
text(result.title.as_str()).size(title_size).into()
|
||||
};
|
||||
container(
|
||||
row![icon_el, title_col]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
)
|
||||
container(row![icon_el, title_col].spacing(8).align_y(iced::Center))
|
||||
.width(Length::Fill)
|
||||
.padding([6, 12])
|
||||
.style(move |_theme| container::Style {
|
||||
@@ -209,7 +214,8 @@ fn view(state: &KLauncherApp) -> Element<'_, Message> {
|
||||
.into()
|
||||
});
|
||||
|
||||
let mut content_children: Vec<Element<'_, Message>> = vec![search_bar.into(), results_list.into()];
|
||||
let mut content_children: Vec<Element<'_, Message>> =
|
||||
vec![search_bar.into(), results_list.into()];
|
||||
if let Some(err) = maybe_error {
|
||||
content_children.push(err);
|
||||
}
|
||||
@@ -261,15 +267,15 @@ pub fn run(
|
||||
update,
|
||||
view,
|
||||
)
|
||||
.title("K-Launcher")
|
||||
.subscription(subscription)
|
||||
.window(window::Settings {
|
||||
size: Size::new(wc.width, wc.height),
|
||||
position: window::Position::Centered,
|
||||
decorations: wc.decorations,
|
||||
transparent: wc.transparent,
|
||||
resizable: wc.resizable,
|
||||
..Default::default()
|
||||
})
|
||||
.run()
|
||||
.title("K-Launcher")
|
||||
.subscription(subscription)
|
||||
.window(window::Settings {
|
||||
size: Size::new(wc.width, wc.height),
|
||||
position: window::Position::Centered,
|
||||
decorations: wc.decorations,
|
||||
transparent: wc.transparent,
|
||||
resizable: wc.resizable,
|
||||
..Default::default()
|
||||
})
|
||||
.run()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user