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:
maj00r
2026-11-15 18:05:26 +01:00
parent a0a6ebdffa
commit 6c696b44e0
13 changed files with 363 additions and 111 deletions

View File

@@ -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))