Implemented "Suggestion for Preview View Change"

https://github.com/prusa3d/Slic3r/issues/415

Use left / right keys to switch between the low / high layer scroll bars
on the 3d preview screen.
This commit is contained in:
bubnikv 2017-07-11 18:21:25 +02:00
parent 6f28818f87
commit 3a813aaef6

View file

@ -92,11 +92,11 @@ sub new {
if ($event->HasModifiers) { if ($event->HasModifiers) {
$event->Skip; $event->Skip;
} else { } else {
if ($key == ord('U') || $key == WXK_RIGHT) { if ($key == ord('U')) {
$slider_high->SetValue($slider_high->GetValue + 1); $slider_high->SetValue($slider_high->GetValue + 1);
$slider_low->SetValue($slider_high->GetValue) if ($event->ShiftDown()); $slider_low->SetValue($slider_high->GetValue) if ($event->ShiftDown());
$self->set_z_idx_high($slider_high->GetValue); $self->set_z_idx_high($slider_high->GetValue);
} elsif ($key == ord('D') || $key == WXK_LEFT) { } elsif ($key == ord('D')) {
$slider_high->SetValue($slider_high->GetValue - 1); $slider_high->SetValue($slider_high->GetValue - 1);
$slider_low->SetValue($slider_high->GetValue) if ($event->ShiftDown()); $slider_low->SetValue($slider_high->GetValue) if ($event->ShiftDown());
$self->set_z_idx_high($slider_high->GetValue); $self->set_z_idx_high($slider_high->GetValue);
@ -112,6 +112,34 @@ sub new {
} }
} }
}); });
EVT_KEY_DOWN($slider_low, sub {
my ($s, $event) = @_;
my $key = $event->GetKeyCode;
if ($event->HasModifiers) {
$event->Skip;
} else {
if ($key == WXK_LEFT) {
} elsif ($key == WXK_RIGHT) {
$slider_high->SetFocus;
} else {
$event->Skip;
}
}
});
EVT_KEY_DOWN($slider_high, sub {
my ($s, $event) = @_;
my $key = $event->GetKeyCode;
if ($event->HasModifiers) {
$event->Skip;
} else {
if ($key == WXK_LEFT) {
$slider_low->SetFocus;
} elsif ($key == WXK_RIGHT) {
} else {
$event->Skip;
}
}
});
EVT_CHECKBOX($self, $checkbox_singlelayer, sub { EVT_CHECKBOX($self, $checkbox_singlelayer, sub {
$self->single_layer($checkbox_singlelayer->GetValue()); $self->single_layer($checkbox_singlelayer->GetValue());
if ($self->single_layer) { if ($self->single_layer) {