fix(audit): wrap overflow-menu labels instead of clipping them
A popup menu is width-capped at ~280px, so the full-sentence German entries in the audit overflow menu ran past the edge. The clipped tail of the reset entry was exactly the "(nur local/dev)" scope that keeps it from reading as "delete evidence", and the label's centre landed outside the hit box. Guard in responsive_test: the page-level overflow sweep cannot see popup menus (their width does not follow the window), which is why this went unnoticed. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
c6a0b1a267
commit
415f8a7ddb
3 changed files with 86 additions and 18 deletions
|
|
@ -326,35 +326,33 @@ class _AuditPageState extends State<AuditPage> {
|
|||
'clear' => _onClearPressed(),
|
||||
_ => null,
|
||||
},
|
||||
// Labels wrap instead of running past the menu edge: a
|
||||
// popup menu is at most 280px wide, and these entries
|
||||
// spell out what they do ("Entwicklungs-Reset: Protokoll
|
||||
// löschen … (nur local/dev)"). Unwrapped, the tail was
|
||||
// clipped — and the clipped part is exactly the
|
||||
// "nur local/dev" that keeps the entry from reading as
|
||||
// "delete evidence".
|
||||
itemBuilder: (ctx) => [
|
||||
PopupMenuItem(
|
||||
value: 'export',
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.download_outlined, size: 16),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Text(AppLocalizations.of(ctx)!.auditExportAction),
|
||||
],
|
||||
child: _menuLabel(
|
||||
Icons.download_outlined,
|
||||
AppLocalizations.of(ctx)!.auditExportAction,
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: 'export-all',
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.archive_outlined, size: 16),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Text(AppLocalizations.of(ctx)!.auditExportAllAction),
|
||||
],
|
||||
child: _menuLabel(
|
||||
Icons.archive_outlined,
|
||||
AppLocalizations.of(ctx)!.auditExportAllAction,
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: 'clear',
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.delete_sweep_outlined, size: 16),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Text(AppLocalizations.of(ctx)!.auditDevResetAction),
|
||||
],
|
||||
child: _menuLabel(
|
||||
Icons.delete_sweep_outlined,
|
||||
AppLocalizations.of(ctx)!.auditDevResetAction,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -456,6 +454,17 @@ class _AuditPageState extends State<AuditPage> {
|
|||
return parts.join('');
|
||||
}
|
||||
|
||||
/// Icon + label for an overflow-menu entry. [Flexible] is the
|
||||
/// point: the menu is width-capped, so a long label has to wrap
|
||||
/// rather than run off the edge.
|
||||
Widget _menuLabel(IconData icon, String label) => Row(
|
||||
children: [
|
||||
Icon(icon, size: 16),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Flexible(child: Text(label)),
|
||||
],
|
||||
);
|
||||
|
||||
Color _toneFor(String type, ThemeData theme) {
|
||||
if (type.endsWith('.failed')) return theme.colorScheme.error;
|
||||
if (type.endsWith('.completed')) return theme.colorScheme.primary;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue