mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-27 17:09:37 +01:00
fix: Sonar's remarks on the screen reader work, and tests for it
The cab panel's drawing and the consist narration are split into smaller steps, with plain switches and concrete return types where Sonar asked. Tests drive the black box panels, both tape views, the key bindings, the windows opened over another, the search count and the themed tree entries, sliders, number boxes, pickers and settings sections headless, as someone at the keyboard with a screen reader meets them.
This commit is contained in:
@@ -164,10 +164,12 @@ public static class ScreenReaderNames
|
||||
}
|
||||
|
||||
/// <summary>The picker's label and what it holds, as the button inside it is read.</summary>
|
||||
public static string? PickerText(string? label, string? value) =>
|
||||
string.IsNullOrEmpty(label) ? value
|
||||
: string.IsNullOrEmpty(value) ? label
|
||||
: $"{label}: {value}";
|
||||
public static string? PickerText(string? label, string? value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(label))
|
||||
return value;
|
||||
return string.IsNullOrEmpty(value) ? label : $"{label}: {value}";
|
||||
}
|
||||
|
||||
/// <summary>Day and month in words, the year too when the picker shows one.</summary>
|
||||
public static string? DateText(DateTimeOffset? date, bool withYear) =>
|
||||
|
||||
Reference in New Issue
Block a user