fix(client/windows): flush the settings headings with the cards below

The shared section() helper carries a 2px left inset -- right for the
hosts/licenses lists it was written for, but in Settings it left every
sub-section heading hanging one nudge right of its card's edge. Use a
settings-local heading pinned flush left, and drop the same inset from the
footer notes, so heading, card and note all share one left edge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 17:35:49 +02:00
parent 51f7ff1b3f
commit 344618e1f0
+16 -2
View File
@@ -171,12 +171,26 @@ fn described(control: impl Into<Element>, caption: &str) -> Element {
.into()
}
/// A settings sub-section heading. Deliberately NOT the shared [`section`] helper: that one
/// carries a 2px left inset (fine over the hosts/licenses lists it was written for), which
/// here left every heading hanging one nudge right of the card edge below it. Flush left, so
/// heading and card share one line.
fn group_heading(label: &str) -> Element {
text_block(label)
.font_size(12.0)
.semibold()
.foreground(ThemeRef::SecondaryText)
.horizontal_alignment(HorizontalAlignment::Left)
.margin(edges(0.0, 14.0, 0.0, 2.0))
.into()
}
/// One settings group: an optional sub-section label, a card of fields, and an optional
/// form-level note under it (Apple's Section header/footer). Groups stack down the page.
fn group(header: Option<&str>, fields: Vec<Element>, footer: Option<&str>) -> Vec<Element> {
let mut out = Vec::with_capacity(3);
if let Some(h) = header {
out.push(section(h));
out.push(group_heading(h));
}
out.push(card(vstack(fields).spacing(14.0)).into());
if let Some(f) = footer {
@@ -186,7 +200,7 @@ fn group(header: Option<&str>, fields: Vec<Element>, footer: Option<&str>) -> Ve
.foreground(ThemeRef::SecondaryText)
.wrap()
.horizontal_alignment(HorizontalAlignment::Left)
.margin(edges(2.0, 6.0, 0.0, 0.0))
.margin(edges(0.0, 6.0, 0.0, 0.0))
.into(),
);
}