fix WLAN menu keyboard accessibility

This commit is contained in:
Jonas Sourlier 2023-02-13 18:11:05 +01:00
parent 1ad20567b8
commit 5c5a70ad73
8 changed files with 60 additions and 2 deletions

View file

@ -34,5 +34,10 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.ActionCenter
NetworkNameTextBlock.Text = network.Name;
SignalStrengthTextBlock.Text = $"{network.SignalStrength}%";
}
public void SetFocus()
{
Button.Focus();
}
}
}

View file

@ -62,7 +62,18 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.ActionCenter
Popup.IsOpen = Popup.IsMouseOver;
}));
Popup.MouseLeave += (o, args) => Task.Delay(250).ContinueWith(_ => Dispatcher.Invoke(() => Popup.IsOpen = IsMouseOver));
Popup.Opened += (o, args) => Grid.Background = Brushes.Gray;
Popup.Opened += (o, args) =>
{
Grid.Background = Brushes.Gray;
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
{
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
if (btn != null)
{
btn.SetFocus();
}
}));
};
Popup.Closed += (o, args) => Grid.Background = originalBrush;
WirelessIcon.Child = GetWirelessIcon(0);

View file

@ -34,5 +34,10 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.Taskbar
NetworkNameTextBlock.Text = network.Name;
SignalStrengthTextBlock.Text = $"{network.SignalStrength}%";
}
public void SetFocus()
{
Button.Focus();
}
}
}

View file

@ -70,6 +70,14 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.Taskbar
{
Background = Brushes.LightGray;
Button.Background = Brushes.LightGray;
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
{
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
if (btn != null)
{
btn.SetFocus();
}
}));
};
Popup.Closed += (o, args) =>

View file

@ -34,5 +34,10 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.ActionCenter
NetworkNameTextBlock.Text = network.Name;
SignalStrengthTextBlock.Text = $"{network.SignalStrength}%";
}
public void SetFocus()
{
Button.Focus();
}
}
}

View file

@ -62,7 +62,18 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.ActionCenter
Popup.IsOpen = Popup.IsMouseOver;
}));
Popup.MouseLeave += (o, args) => Task.Delay(250).ContinueWith(_ => Dispatcher.Invoke(() => Popup.IsOpen = IsMouseOver));
Popup.Opened += (o, args) => Grid.Background = Brushes.Gray;
Popup.Opened += (o, args) =>
{
Grid.Background = Brushes.Gray;
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
{
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
if (btn != null)
{
btn.SetFocus();
}
}));
};
Popup.Closed += (o, args) => Grid.Background = originalBrush;
WirelessIcon.Child = GetWirelessIcon(0);

View file

@ -34,5 +34,10 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.Taskbar
NetworkNameTextBlock.Text = network.Name;
SignalStrengthTextBlock.Text = $"{network.SignalStrength}%";
}
public void SetFocus()
{
Button.Focus();
}
}
}

View file

@ -70,6 +70,14 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.Taskbar
{
Background = Brushes.LightGray;
Button.Background = Brushes.LightGray;
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
{
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
if (btn != null)
{
btn.SetFocus();
}
}));
};
Popup.Closed += (o, args) =>