fix(train): the Record sheet's music choice on a row of its own, each label on one line

The segmented choice of Music, Metronome and Off sat in the music
tile's subtitle, beside its icon, where a phone of 360 dp wrapped
"Metronome" into "Metronom/e". It takes the list's whole width now,
under its title, each label on one line and scaled down where larger
text still leaves too little room. ADR 0030, D65.

Whats-New: The Record sheet's Music, Metronome and Off each fit on one line.
Whats-New-De: Musik, Metronom und Aus passen im Aufzeichnen-Blatt jeweils auf eine Zeile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-04 20:40:17 +01:00
commit 0c2d4ffecc
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -307,33 +307,41 @@ class _RecordSheetState() extends State<_RecordSheet> {
final chosen = _music == MusicChoice.music && !hasMusic
? MusicChoice.off
: _music;
return ListTile(
leading: const Icon(LucideIcons.music),
title: Text(l10n.recordMusic),
subtitle: Padding(
padding: const EdgeInsets.only(top: 8),
child: SegmentedButton<MusicChoice>(
showSelectedIcon: false,
segments: [
ButtonSegment(
value: MusicChoice.music,
label: Text(l10n.recordMusicOn),
enabled: hasMusic,
),
ButtonSegment(
value: MusicChoice.metronome,
label: Text(l10n.recordMetronome),
),
ButtonSegment(
value: MusicChoice.off,
label: Text(l10n.recordMusicOff),
),
],
selected: {chosen},
onSelectionChanged: (choice) =>
setState(() => _music = choice.single),
// The choice on a row of its own, as wide as the list, each label on
// one line, smaller where it still doesn't fit: beside the icon, a
// phone wrapped "Metronome" in two (D65).
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
ListTile(
leading: const Icon(LucideIcons.music),
title: Text(l10n.recordMusic),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: SegmentedButton<MusicChoice>(
showSelectedIcon: false,
segments: [
ButtonSegment(
value: MusicChoice.music,
label: _OneLine(l10n.recordMusicOn),
enabled: hasMusic,
),
ButtonSegment(
value: MusicChoice.metronome,
label: _OneLine(l10n.recordMetronome),
),
ButtonSegment(
value: MusicChoice.off,
label: _OneLine(l10n.recordMusicOff),
),
],
selected: {chosen},
onSelectionChanged: (choice) =>
setState(() => _music = choice.single),
),
),
],
);
},
);
@ -478,3 +486,12 @@ Future<RecordingState> startedOrRefused(RecordingBloc bloc) =>
state.bluetoothRefused ||
state.rowerMissing,
);
/// A segment's label on one line, scaled down where it doesn't fit.
class const _OneLine(final String text) extends StatelessWidget {
@override
Widget build(BuildContext context) => FittedBox(
fit: BoxFit.scaleDown,
child: Text(text, maxLines: 1, softWrap: false),
);
}