From 26a80efde5b85e0ae6f2d143b0ca89bd0537866b Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 12 Nov 2026 01:21:05 +0000 Subject: [PATCH] cargo fmt --- crates/color/src/ui/harmony.rs | 18 ++++++++---------- crates/color/src/ui/palette.rs | 2 +- crates/ui-contract/src/primitives/text.rs | 12 +++++++++++- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/crates/color/src/ui/harmony.rs b/crates/color/src/ui/harmony.rs index 5e3e5146e..1422cbcd1 100644 --- a/crates/color/src/ui/harmony.rs +++ b/crates/color/src/ui/harmony.rs @@ -330,8 +330,7 @@ impl<'a> HarmonyPanel<'a> { let strip: Vec<(Label, Srgba)> = guide.colors.iter().map(|c| (Label::from(c.to_hex()), *c)).collect(); let mut strip_selection = Selection::default(); - let out = - SwatchTable::new(words.harmony.clone(), &strip) + let out = SwatchTable::new(words.harmony.clone(), &strip) .per_row(strip.len().max(1)) .span(true) .selection(Bind::bound(&mut strip_selection)) @@ -344,14 +343,13 @@ impl<'a> HarmonyPanel<'a> { let centre = guide.centre(); let flat: Vec<(Label, Srgba)> = guide.grid.iter().flatten().map(|c| (Label::from(c.to_hex()), *c)).collect(); let mut selection = if before_picked.guide == stamp { before_picked.selection.clone() } else { Selection::default() }; - let SwatchTableOutput { selected, chosen: cells, .. } = - SwatchTable::new(words.variations.clone(), &flat) - .multiple(true) - .per_row(columns) - .span(true) - .marked(move |&at| at % columns == centre) - .selection(Bind::bound(&mut selection)) - .show_all(ui); + let SwatchTableOutput { selected, chosen: cells, .. } = SwatchTable::new(words.variations.clone(), &flat) + .multiple(true) + .per_row(columns) + .span(true) + .marked(move |&at| at % columns == centre) + .selection(Bind::bound(&mut selection)) + .show_all(ui); if let Some(i) = selected && cells.len() == 1 { diff --git a/crates/color/src/ui/palette.rs b/crates/color/src/ui/palette.rs index bf65f6d09..e19cae514 100644 --- a/crates/color/src/ui/palette.rs +++ b/crates/color/src/ui/palette.rs @@ -4,12 +4,12 @@ use craft_behavior::{DisplayOrder, EditEvent, ItemSource, Metrics, Mixed, Selection, TileLayout}; use craft_theme::Srgba; use craft_ui::choice::{Swatch, SwatchMetrics}; -use craft_ui::list::RowTest; use craft_ui::contract::{ ActivateOn, Bind, BindMut, Collection, CollectionEvent, CollectionProps, Common, Component, ContainerProps, Cx, Held, NoValue, Outcome, Pattern, Props, Role, SelectMode, ShowCollection as _, ShowContainer as _, Sizing, }; use craft_ui::layout_components::Stack; +use craft_ui::list::RowTest; use craft_ui::runtime::env::Label; use craft_ui::style::{ComponentStyle, StyleCx}; use egui::{Response, Ui, Vec2}; diff --git a/crates/ui-contract/src/primitives/text.rs b/crates/ui-contract/src/primitives/text.rs index 73e3690a1..db3f3beee 100644 --- a/crates/ui-contract/src/primitives/text.rs +++ b/crates/ui-contract/src/primitives/text.rs @@ -80,7 +80,17 @@ pub struct Span<'a> { impl<'a> Span<'a> { /// A plain span. pub fn new(text: impl Into>) -> Self { - Span { text: text.into(), italic: false, tabular: false, mono: false, muted: false, shortcut: false, highlight: false, underline: false, strong: false } + Span { + text: text.into(), + italic: false, + tabular: false, + mono: false, + muted: false, + shortcut: false, + highlight: false, + underline: false, + strong: false, + } } /// Italic.