forked from 1b-agent/opencadstudio-upstream
Select Color: rustfmt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013rGmDUNr1hUf4zo1X3dak8
This commit is contained in:
1 file changed
+15
-15
@@ -699,11 +699,9 @@ impl ColorPicker {
|
|||||||
shown
|
shown
|
||||||
.chunks(DOC_COLUMNS)
|
.chunks(DOC_COLUMNS)
|
||||||
.fold(column![].spacing(4), |grid, chunk| {
|
.fold(column![].spacing(4), |grid, chunk| {
|
||||||
let line = chunk
|
let line = chunk.iter().fold(row![].spacing(4), |line, &(i, entry)| {
|
||||||
.iter()
|
line.push(self.doc_swatch(i, entry))
|
||||||
.fold(row![].spacing(4), |line, &(i, entry)| {
|
});
|
||||||
line.push(self.doc_swatch(i, entry))
|
|
||||||
});
|
|
||||||
let line = (chunk.len()..DOC_COLUMNS)
|
let line = (chunk.len()..DOC_COLUMNS)
|
||||||
.fold(line, |line, _| line.push(Space::new().width(Length::Fill)));
|
.fold(line, |line, _| line.push(Space::new().width(Length::Fill)));
|
||||||
grid.push(line)
|
grid.push(line)
|
||||||
@@ -716,11 +714,11 @@ impl ColorPicker {
|
|||||||
let selected = self.pending == entry.color && self.pending_name == entry.name;
|
let selected = self.pending == entry.color && self.pending_name == entry.name;
|
||||||
button(Space::new())
|
button(Space::new())
|
||||||
.on_press(picker_msg(ColorPickerMsg::PickDocument(i)))
|
.on_press(picker_msg(ColorPickerMsg::PickDocument(i)))
|
||||||
.padding(0)
|
.padding(0)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.height(30)
|
.height(30)
|
||||||
.style(move |theme: &Theme, status| swatch_button_style(theme, status, fill, selected))
|
.style(move |theme: &Theme, status| swatch_button_style(theme, status, fill, selected))
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn books_tab(&self) -> Element<'_, Message> {
|
fn books_tab(&self) -> Element<'_, Message> {
|
||||||
@@ -758,11 +756,13 @@ impl ColorPicker {
|
|||||||
row![
|
row![
|
||||||
search_box(&self.book_query, |query| ColorPickerMsg::BookQuery(query)),
|
search_box(&self.book_query, |query| ColorPickerMsg::BookQuery(query)),
|
||||||
load_button(
|
load_button(
|
||||||
container(secondary_icon(crate::ui::icons::themed_handle(
|
container(
|
||||||
crate::ui::icons::FOLDER_OPEN
|
secondary_icon(crate::ui::icons::themed_handle(
|
||||||
))
|
crate::ui::icons::FOLDER_OPEN
|
||||||
.width(16)
|
))
|
||||||
.height(16))
|
.width(16)
|
||||||
|
.height(16)
|
||||||
|
)
|
||||||
.center(Length::Fill)
|
.center(Length::Fill)
|
||||||
.into()
|
.into()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user