From 5fd643b1662a0e5b1a17e180c156d41a820d14b3 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 21 Jul 2025 15:56:11 -0600 Subject: [PATCH] dialog: break options into two rows when condensed --- src/dialog.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dialog.rs b/src/dialog.rs index f6c3908..2bca885 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -521,6 +521,7 @@ impl App { space_l, .. } = theme::active().cosmic().spacing; + let is_condensed = self.core().is_condensed(); let mut col = widget::column::with_capacity(2).spacing(space_xxs); if let DialogKind::SaveFile { filename } = &self.flags.kind { @@ -533,7 +534,9 @@ impl App { } let mut row = widget::row::with_capacity( - if !self.filters.is_empty() { 1 } else { 0 } + self.choices.len() * 2 + 3, + if !self.filters.is_empty() { 1 } else { 0 } + + self.choices.len() * 2 + + if is_condensed { 0 } else { 3 }, ) .align_y(Alignment::Center) .spacing(space_xxs); @@ -564,6 +567,13 @@ impl App { } } } + + if is_condensed { + col = col.push(row); + row = widget::row::with_capacity(3) + .align_y(Alignment::Center) + .spacing(space_xxs); + } row = row.push(widget::horizontal_space()); row = row.push(widget::button::standard(fl!("cancel")).on_press(Message::Cancel));