From a71ab4ce112999bdd73a36edbf88757428406a14 Mon Sep 17 00:00:00 2001 From: leyoda Date: Fri, 22 May 2026 08:05:13 +0200 Subject: [PATCH] fix(dialog): keep sortable column headers visible in narrow Save/Open windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Mode::Dialog (file picker), the location_view used to drop the sortable heading row whenever the window dropped below the 600px condensed threshold — which is most of the time for Save As dialogs (the min window width is 360px). Users lost the ability to click Name/Modified/Size to toggle ascending / descending sort. Add a compact heading row reused in dialog mode when the window is condensed. It keeps the same Message::ToggleSort(HeadingOptions) wiring; only the column widths differ (Length::Shrink instead of Fixed) so it fits in a narrow dialog. The regular wide layout is unchanged. Leyoda 2026 – GPLv3 --- src/tab.rs | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/tab.rs b/src/tab.rs index d36aff0..23de5d6 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -5074,6 +5074,21 @@ impl Tab { .height(Length::Fixed((space_m + 4).into())) .padding([0, space_xxs]); + let dialog_mode = matches!(self.mode, Mode::Dialog(_)); + let heading_row_compact = widget::row::with_children([ + heading_item(fl!("name"), Length::Fill, HeadingOptions::Name), + if self.location.is_trash() { + heading_item(fl!("trashed-on"), Length::Shrink, HeadingOptions::TrashedOn) + } else { + heading_item(fl!("modified"), Length::Shrink, HeadingOptions::Modified) + }, + heading_item(fl!("size"), Length::Shrink, HeadingOptions::Size), + ]) + .align_y(Alignment::Center) + .spacing(space_s) + .height(Length::Fixed((space_m + 4).into())) + .padding([0, space_xxs]); + let accent_rule = rule::horizontal(1).class(theme::Rule::Custom(Box::new(|theme| rule::Style { color: theme.cosmic().accent_color().into(), @@ -5158,9 +5173,14 @@ impl Tab { let mut column = widget::column::with_capacity(4).padding([0, space_s]); column = column.push(row); column = column.push(accent_rule); - if self.config.view == View::List && !condensed { - column = column.push(heading_row); - column = column.push(heading_rule); + if self.config.view == View::List { + if !condensed { + column = column.push(heading_row); + column = column.push(heading_rule); + } else if dialog_mode { + column = column.push(heading_row_compact); + column = column.push(heading_rule); + } } return column.into(); } @@ -5306,9 +5326,14 @@ impl Tab { column = column.push(row); column = column.push(accent_rule); - if self.config.view == View::List && !condensed { - column = column.push(heading_row); - column = column.push(heading_rule); + if self.config.view == View::List { + if !condensed { + column = column.push(heading_row); + column = column.push(heading_rule); + } else if dialog_mode { + column = column.push(heading_row_compact); + column = column.push(heading_rule); + } } let mouse_area = crate::mouse_area::MouseArea::new(column)