Quality of Life improvements to DialogCustomInput

This commit is contained in:
ruri
2020-03-23 01:58:09 +01:00
parent 604187b5ce
commit c32bb644cb
2 changed files with 10 additions and 1 deletions
@@ -9,7 +9,7 @@
<StackPanel Height="100" Width="490" Margin="5">
<TextBox x:Name="questionTextbox" Text="PLACEHOLDER" BorderThickness="0" Background="Transparent" IsReadOnly="True"/>
<TextBox x:Name="answerTextbox"/>
<TextBox x:Name="answerTextbox" KeyDown="answerTextbox_KeyDown" />
<Button x:Name="acceptButton" Content="ACCEPT" Click="acceptButton_Click" Margin="0 5 0 0"/>
</StackPanel>
</Page>
@@ -23,6 +23,7 @@ namespace OpenBullet
Caller = caller;
VariableName = variableName;
questionTextbox.Text = question;
answerTextbox.Focus();
}
private void acceptButton_Click(object sender, RoutedEventArgs e)
@@ -37,5 +38,13 @@ namespace OpenBullet
}
((MainDialog)Parent).Close();
}
private void answerTextbox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.Return)
{
acceptButton_Click(sender, null);
}
}
}
}