Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
a71ab4ce11 fix(dialog): keep sortable column headers visible in narrow Save/Open windows
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
2026-05-22 08:05:13 +02:00

View file

@ -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)