Fixed usability issues with lock screen and password dialog.

This commit is contained in:
Damian Büchel 2022-07-28 12:39:58 +02:00
parent 6f9420ca8f
commit a7bb5f543a
6 changed files with 25 additions and 20 deletions

View file

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SafeExamBrowser.UserInterface.Desktop"
mc:Ignorable="d" d:DesignWidth="1500" ResizeMode="NoResize" Topmost="True" WindowState="Maximized" WindowStyle="None">
<Grid Background="Red">
<Grid Background="Red" FocusManager.FocusedElement="{Binding ElementName=Password}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />

View file

@ -48,7 +48,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
this.text = text;
InitializeComponent();
InitializeLockWindow(message, title, options);
InitializeLockScreen(message, title, options);
}
public void BringToForeground()
@ -88,15 +88,16 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
return result;
}
private void InitializeLockWindow(string message, string title, IEnumerable<LockScreenOption> options)
private void InitializeLockScreen(string message, string title, IEnumerable<LockScreenOption> options)
{
windows = new List<Window>();
Button.Content = text.Get(TextKey.LockScreen_UnlockButton);
Button.Click += Button_Click;
Heading.Text = title;
Loaded += (o, args) => Activate();
Message.Text = message;
Password.KeyUp += Password_KeyUp;
Password.KeyDown += Password_KeyDown;
foreach (var option in options)
{
@ -164,7 +165,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
autoResetEvent.Set();
}
private void Password_KeyUp(object sender, KeyEventArgs e)
private void Password_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{

View file

@ -75,16 +75,17 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
Title = title;
WindowStartupLocation = WindowStartupLocation.CenterScreen;
Closed += (o, args) => closed?.Invoke();
Closing += (o, args) => closing?.Invoke();
Loaded += (o, args) => Activate();
CancelButton.Content = text.Get(TextKey.PasswordDialog_Cancel);
CancelButton.Click += CancelButton_Click;
ConfirmButton.Content = text.Get(TextKey.PasswordDialog_Confirm);
ConfirmButton.Click += ConfirmButton_Click;
Closed += (o, args) => closed?.Invoke();
Closing += (o, args) => closing?.Invoke();
Loaded += (o, args) => Activate();
Password.KeyUp += Password_KeyUp;
Password.KeyDown += Password_KeyDown;
}
private void CancelButton_Click(object sender, RoutedEventArgs e)
@ -99,7 +100,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
Close();
}
private void Password_KeyUp(object sender, KeyEventArgs e)
private void Password_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{

View file

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SafeExamBrowser.UserInterface.Mobile"
mc:Ignorable="d" d:DesignWidth="1500" FontSize="16" ResizeMode="NoResize" Topmost="True" WindowState="Maximized" WindowStyle="None">
<Grid Background="Red">
<Grid Background="Red" FocusManager.FocusedElement="{Binding ElementName=Password}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />

View file

@ -48,7 +48,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
this.text = text;
InitializeComponent();
InitializeLockWindow(message, title, options);
InitializeLockScreen(message, title, options);
}
public void BringToForeground()
@ -88,15 +88,16 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
return result;
}
private void InitializeLockWindow(string message, string title, IEnumerable<LockScreenOption> options)
private void InitializeLockScreen(string message, string title, IEnumerable<LockScreenOption> options)
{
windows = new List<Window>();
Button.Content = text.Get(TextKey.LockScreen_UnlockButton);
Button.Click += Button_Click;
Heading.Text = title;
Loaded += (o, args) => Activate();
Message.Text = message;
Password.KeyUp += Password_KeyUp;
Password.KeyDown += Password_KeyDown;
foreach (var option in options)
{
@ -164,7 +165,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
autoResetEvent.Set();
}
private void Password_KeyUp(object sender, KeyEventArgs e)
private void Password_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{

View file

@ -85,16 +85,18 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
Message.Text = message;
Title = title;
Closed += (o, args) => closed?.Invoke();
Closing += (o, args) => closing?.Invoke();
Loaded += (o, args) => Activate();
CancelButton.Content = text.Get(TextKey.PasswordDialog_Cancel);
CancelButton.Click += CancelButton_Click;
ConfirmButton.Content = text.Get(TextKey.PasswordDialog_Confirm);
ConfirmButton.Click += ConfirmButton_Click;
Closed += (o, args) => closed?.Invoke();
Closing += (o, args) => closing?.Invoke();
Loaded += (o, args) => Activate();
Password.KeyUp += Password_KeyUp;
Password.KeyDown += Password_KeyDown;
SystemParameters.StaticPropertyChanged += SystemParameters_StaticPropertyChanged;
}
@ -110,7 +112,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
Close();
}
private void Password_KeyUp(object sender, KeyEventArgs e)
private void Password_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{