style: apply cargo fmt across workspace

This commit is contained in:
Karim Jerbi committed 2026-10-11 03:14:29 +01:00
1 parent 85710e5454
commit 9cf9ff2c5c
531 files changed
+57740 -33906

No files matched your search

+40 -33
View File
@@ -7,10 +7,10 @@
//! unsaved-changes guard on close.
use crate::app::Message;
use crate::t;
use crate::ui::style::common::muted_style;
use iced::widget::{button, column, container, row, scrollable, text, text_input, Space};
use iced::{Background, Element, Length, Theme};
use crate::t;
/// Which column of an alias row a text edit targets.
#[derive(Clone, Copy, Debug)]
@@ -37,18 +37,16 @@ fn danger_input_style(
let danger = theme.palette().danger.base;
iced::widget::text_input::Style {
background: Background::Color(theme.palette().danger.weak.color),
border: iced::border::rounded(4)
.color(danger.color)
.width(
if matches!(
status,
iced::widget::text_input::Status::Focused { is_hovered: _ }
) {
1.5
} else {
1.0
},
),
border: iced::border::rounded(4).color(danger.color).width(
if matches!(
status,
iced::widget::text_input::Status::Focused { is_hovered: _ }
) {
1.5
} else {
1.0
},
),
icon: danger.color,
placeholder: danger.color.scale_alpha(0.7),
value: danger.text,
@@ -77,7 +75,12 @@ pub fn view_window<'a>(
// Right gutter reserved so the scrollbar has its own lane and never sits on
// top of the row delete (✕) buttons. Applied to both the header and the
// scrollable rows so the columns stay aligned.
let gutter = iced::Padding { top: 0.0, right: GUTTER, bottom: 0.0, left: 0.0 };
let gutter = iced::Padding {
top: 0.0,
right: GUTTER,
bottom: 0.0,
left: 0.0,
};
let head = container(
row![
@@ -94,7 +97,11 @@ pub fn view_window<'a>(
let alias_key = alias.trim().to_uppercase();
let duplicate = !alias_key.is_empty() && duplicate_aliases.contains(alias_key.as_str());
let alias_box = text_input(t!("alias").as_ref(), alias)
.on_input(move |v| Message::AliasEditorInput { idx, field: AliasField::Alias, value: v })
.on_input(move |v| Message::AliasEditorInput {
idx,
field: AliasField::Alias,
value: v,
})
.size(13)
.padding([3, 6])
.width(Length::Fixed(120.0));
@@ -103,10 +110,13 @@ pub fn view_window<'a>(
} else {
alias_box
};
let unknown_command =
!cmd.trim().is_empty() && unknown_commands.contains(cmd.trim());
let unknown_command = !cmd.trim().is_empty() && unknown_commands.contains(cmd.trim());
let cmd_box = text_input(t!("command").as_ref(), cmd)
.on_input(move |v| Message::AliasEditorInput { idx, field: AliasField::Command, value: v })
.on_input(move |v| Message::AliasEditorInput {
idx,
field: AliasField::Command,
value: v,
})
.size(13)
.padding([3, 6])
.width(sizing.width);
@@ -261,9 +271,15 @@ pub fn view_window<'a>(
Space::new().height(6),
conflict_banner,
Space::new().height(4),
row![stats, add_area, reset_area, Space::new().width(sizing.width), apply_area]
.spacing(8)
.align_y(iced::Center),
row![
stats,
add_area,
reset_area,
Space::new().width(sizing.width),
apply_area
]
.spacing(8)
.align_y(iced::Center),
]
.spacing(6)
.width(sizing.width)
@@ -273,9 +289,7 @@ pub fn view_window<'a>(
.width(sizing.width)
.height(sizing.height)
.style(|theme: &Theme| container::Style {
background: Some(Background::Color(
theme.palette().background.base.color,
)),
background: Some(Background::Color(theme.palette().background.base.color)),
..Default::default()
});
@@ -290,12 +304,7 @@ pub fn view_window<'a>(
.height(Length::Fill)
.style(|theme: &Theme| container::Style {
background: Some(Background::Color(
theme
.palette()
.background
.strongest
.color
.scale_alpha(0.55),
theme.palette().background.strongest.color.scale_alpha(0.55),
)),
..Default::default()
}),
@@ -323,9 +332,7 @@ pub fn view_window<'a>(
.padding(16)
.width(Length::Fixed(320.0))
.style(|theme: &Theme| container::Style {
background: Some(Background::Color(
theme.palette().background.base.color,
)),
background: Some(Background::Color(theme.palette().background.base.color)),
border: iced::Border {
color: theme.palette().background.neutral.color,
width: 1.0,