mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-09-24 06:53:16 +08:00
One more fix for slider. #3779
This commit is contained in:
parent
8250839fd5
commit
ddad7ce25f
@ -548,11 +548,16 @@ sub BUILD {
|
|||||||
EVT_TEXT($self->parent, $textctrl, sub {
|
EVT_TEXT($self->parent, $textctrl, sub {
|
||||||
my $value = $textctrl->GetValue;
|
my $value = $textctrl->GetValue;
|
||||||
if ($value =~ /^-?\d+(\.\d*)?$/) {
|
if ($value =~ /^-?\d+(\.\d*)?$/) {
|
||||||
$self->set_value($value);
|
# Update the slider without re-updating the text field being modified.
|
||||||
|
$self->disable_change_event(1);
|
||||||
|
$self->slider->SetValue($value*$self->scale);
|
||||||
|
$self->disable_change_event(0);
|
||||||
|
|
||||||
$self->_on_change($self->option->opt_id);
|
$self->_on_change($self->option->opt_id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
EVT_KILL_FOCUS($textctrl, sub {
|
EVT_KILL_FOCUS($textctrl, sub {
|
||||||
|
$self->_update_textctrl;
|
||||||
$self->_on_kill_focus($self->option->opt_id, @_);
|
$self->_on_kill_focus($self->option->opt_id, @_);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -573,6 +578,7 @@ sub get_value {
|
|||||||
|
|
||||||
sub _update_textctrl {
|
sub _update_textctrl {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
$self->textctrl->ChangeValue($self->get_value);
|
$self->textctrl->ChangeValue($self->get_value);
|
||||||
$self->textctrl->SetInsertionPointEnd;
|
$self->textctrl->SetInsertionPointEnd;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user