Address tester feedback: snackbar, filter dialog, text scaling
- Rule-deleted snackbar now auto-dismisses (persist: false) and snackbar actions use a high-contrast colour in both themes - Add-rule dialog keeps the floating label visible with the keyboard up - Dismiss focus/keyboard before swapping tab routes - Repeater status: full-width tiles on phones, no shrink-to-fit values, multi-part stats on separate lines, drop "0 days" from durations - App bar titles respect the system font size instead of scaling down; contacts controls grow with text scale; larger nav labels - Fix duplicated flood value in Japanese duplicates string
This commit is contained in:
1 parent
394df3109b
commit
03495effe6
49 files changed
+304
-39
No files matched your search
@@ -697,6 +697,7 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
}
|
||||
|
||||
void _handleQuickSwitch(int index, BuildContext context) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (index == 1) return;
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
||||
@@ -795,7 +795,7 @@ class _ContactsScreenState extends State<ContactsScreen>
|
||||
),
|
||||
],
|
||||
child: SizedBox(
|
||||
height: 48,
|
||||
height: _controlHeight(context),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Theme.of(context).colorScheme.outline),
|
||||
@@ -821,6 +821,13 @@ class _ContactsScreenState extends State<ContactsScreen>
|
||||
);
|
||||
}
|
||||
|
||||
/// Height of the group/search controls; grows with the system font size so
|
||||
/// larger text is not clipped.
|
||||
double _controlHeight(BuildContext context) {
|
||||
final textHeight = MediaQuery.textScalerOf(context).scale(16) * 1.5;
|
||||
return (textHeight + 20).clamp(48.0, 120.0);
|
||||
}
|
||||
|
||||
Widget _buildContactsBody(BuildContext context, MeshCoreConnector connector) {
|
||||
final viewState = context.watch<UiViewStateService>();
|
||||
final contacts = connector.contacts;
|
||||
@@ -958,7 +965,7 @@ class _ContactsScreenState extends State<ContactsScreen>
|
||||
width: viewState.contactsSearchExpanded
|
||||
? searchExpandedWidth
|
||||
: searchCollapsedWidth,
|
||||
height: 48,
|
||||
height: _controlHeight(context),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
@@ -1266,6 +1273,7 @@ class _ContactsScreenState extends State<ContactsScreen>
|
||||
}
|
||||
|
||||
void _handleQuickSwitch(int index, BuildContext context) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (index == 0) return;
|
||||
switch (index) {
|
||||
case 1:
|
||||
|
||||
@@ -1728,6 +1728,7 @@ class _LineOfSightMapScreenState extends State<LineOfSightMapScreen> {
|
||||
}
|
||||
|
||||
void _handleQuickSwitch(int index, BuildContext context) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (index == 2) {
|
||||
Navigator.pop(context);
|
||||
return;
|
||||
|
||||
@@ -3170,6 +3170,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
||||
}
|
||||
|
||||
void _handleQuickSwitch(int index, BuildContext context) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (index == 2) return;
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
||||
@@ -178,6 +178,8 @@ class _RulesList extends StatelessWidget {
|
||||
SnackBar(
|
||||
content: Text(l10n.messageFilter_ruleDeleted),
|
||||
duration: const Duration(seconds: 6),
|
||||
// Newer Flutter persists snackbars with an action unless told not to.
|
||||
persist: false,
|
||||
action: SnackBarAction(
|
||||
label: l10n.common_undo,
|
||||
onPressed: () =>
|
||||
|
||||
@@ -374,15 +374,24 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
final hours = (seconds % 86400) ~/ 3600;
|
||||
final minutes = (seconds % 3600) ~/ 60;
|
||||
final secs = seconds % 60;
|
||||
if (days == 0) return l10n.repeater_hoursMinsSecs(hours, minutes, secs);
|
||||
return l10n.repeater_daysHoursMinsSecs(days, hours, minutes, secs);
|
||||
}
|
||||
|
||||
/// Puts each "Label: n" part of a multi-part stat on its own line. Matches
|
||||
/// the comma separators used across locales (ASCII, fullwidth, ideographic,
|
||||
/// Arabic); the values themselves are unformatted integers.
|
||||
static final _partSeparator = RegExp(r'\s*[,\uFF0C\u3001\u060C]\s*');
|
||||
String _multiLine(String text) => text.split(_partSeparator).join('\n');
|
||||
|
||||
String _packetTxText() {
|
||||
if (_packetsSent == null) return '—';
|
||||
final l10n = context.l10n;
|
||||
final flood = _formatValue(_floodTx);
|
||||
final direct = _formatValue(_directTx);
|
||||
return l10n.repeater_packetTxTotal(_packetsSent!, flood, direct);
|
||||
return _multiLine(
|
||||
l10n.repeater_packetTxTotal(_packetsSent!, flood, direct),
|
||||
);
|
||||
}
|
||||
|
||||
String _packetRxText() {
|
||||
@@ -390,7 +399,9 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
final l10n = context.l10n;
|
||||
final flood = _formatValue(_floodRx);
|
||||
final direct = _formatValue(_directRx);
|
||||
return l10n.repeater_packetRxTotal(_packetsRecv!, flood, direct);
|
||||
return _multiLine(
|
||||
l10n.repeater_packetRxTotal(_packetsRecv!, flood, direct),
|
||||
);
|
||||
}
|
||||
|
||||
String _chanUtilText() {
|
||||
@@ -403,7 +414,7 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
if (_dupFlood != null || _dupDirect != null) {
|
||||
final flood = _formatValue(_dupFlood);
|
||||
final direct = _formatValue(_dupDirect);
|
||||
return l10n.repeater_duplicatesFloodDirect(flood, direct);
|
||||
return _multiLine(l10n.repeater_duplicatesFloodDirect(flood, direct));
|
||||
}
|
||||
if (_packetsRecv == null || _floodRx == null || _directRx == null) {
|
||||
return '—';
|
||||
@@ -702,7 +713,8 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
final textScaler = MediaQuery.textScalerOf(context);
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final columns = constraints.maxWidth / textScaler.scale(1) < 320
|
||||
// One full-width tile per row on phones; two columns on wide screens.
|
||||
final columns = constraints.maxWidth / textScaler.scale(1) < 520
|
||||
? 1
|
||||
: 2;
|
||||
// Rows size to their tallest tile, so labels that wrap at large
|
||||
|
||||
Reference in new issue
Block a user