Skip to content

Commit

Permalink
Pressing ENTER on polygon resize window now applies the values
Browse files Browse the repository at this point in the history
fixes #1318
  • Loading branch information
vchelaru committed Jan 24, 2024
1 parent eb01736 commit ec91cb5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
</Grid.ColumnDefinitions>

<Label Content="{x:Static localization:Texts.Width}" />
<TextBox Grid.Column="1" Width="80" HorizontalAlignment="Left" Text="{Binding WidthPercentage}"></TextBox>
<TextBox Grid.Column="1" Width="80" HorizontalAlignment="Left" KeyDown="WidthTextBox_KeyDown" Text="{Binding WidthPercentage}"></TextBox>
<Label Grid.Column="2">%</Label>

<Label Grid.Row="1" Content="{x:Static localization:Texts.Height}" />
<TextBox Grid.Row="1" Grid.Column="1" Width="80" HorizontalAlignment="Left" Text="{Binding HeightPercentage}"></TextBox>
<TextBox Grid.Row="1" Grid.Column="1" Width="80" HorizontalAlignment="Left" KeyDown="HeightTextBox_KeyDown" Text="{Binding HeightPercentage}"></TextBox>
<Label Grid.Row="1" Grid.Column="2">%</Label>

</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ private void Button_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = true;
}

private void WidthTextBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if(e.Key == System.Windows.Input.Key.Enter)
{
this.DialogResult = true;
}
}

private void HeightTextBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.Enter)
{
this.DialogResult = true;
}
}
}

// maybe move to a different file eventually?
Expand Down

0 comments on commit ec91cb5

Please sign in to comment.