mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-23 00:24:41 +01:00
fix: a screen reader finds its way by landmarks and hears what a click changed
Titled panels are named groups, so the reader says which one focus went into. The tab bar and the settings categories are navigation, the page is the main part, the search boxes are search. A quality level, a section put back to its defaults, settings reloaded, the weather put back or its time set to now are spoken, as is the save status.
This commit is contained in:
@@ -836,6 +836,7 @@ public partial class Scenarios : UserControl
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
weatherTime.SelectedTime = new TimeSpan(now.Hour, now.Minute, 0);
|
||||
Announcer.Say(this, ScreenReaderNames.PickerText(App.Loc["Time"], ScreenReaderNames.TimeText(weatherTime.SelectedTime)));
|
||||
}
|
||||
|
||||
private void WeatherRestore_OnClick(object? sender, RoutedEventArgs e)
|
||||
@@ -843,8 +844,18 @@ public partial class Scenarios : UserControl
|
||||
if (_currentScenery is null) return;
|
||||
_currentScenery.Weather.Restore();
|
||||
ShowWeather(_currentScenery);
|
||||
Announcer.Say(this, WeatherSummary());
|
||||
}
|
||||
|
||||
/// <summary>The weather as a reader hears it once put back: every field and its value.</summary>
|
||||
private string WeatherSummary() => string.Join(", ",
|
||||
ScreenReaderNames.PickerText(App.Loc["Date"], ScreenReaderNames.DateText(weatherDate.SelectedDate, weatherDate.YearVisible)),
|
||||
ScreenReaderNames.PickerText(App.Loc["Season"], ScreenReaderNames.TextOf(weatherSeason.SelectedItem)),
|
||||
ScreenReaderNames.PickerText(App.Loc["Time"], ScreenReaderNames.TimeText(weatherTime.SelectedTime)),
|
||||
ScreenReaderNames.PickerText(App.Loc["Temperature"], weatherTempLabel.Text),
|
||||
ScreenReaderNames.PickerText(App.Loc["Visibility"], weatherFogLabel.Text),
|
||||
ScreenReaderNames.PickerText(App.Loc["Overcast"], ScreenReaderNames.TextOf(weatherOvercast.SelectedItem)));
|
||||
|
||||
private static TimeSpan? ParseTime(string? text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
|
||||
Reference in New Issue
Block a user