Force unfocusing of all input fields when saving a preset, otherwise the currently focused one might be ignored. #750 #624

degen-loop-screen
Alessandro Ranellucci 2012-10-22 16:03:08 +02:00
parent c793a2657f
commit 28b56ae840
1 changed files with 6 additions and 0 deletions

View File

@ -85,6 +85,12 @@ sub new {
});
EVT_BUTTON($self, $self->{btn_save_preset}, sub {
# since buttons (and choices too) don't get focus on Mac, we set focus manually
# to the treectrl so that the EVT_* events are fired for the input field having
# focus currently. is there anything better than this?
$self->{treectrl}->SetFocus;
my $preset = $self->current_preset;
my $default_name = $preset->{default} ? 'Untitled' : basename($preset->{name});
$default_name =~ s/\.ini$//i;