Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-11-30 19:45:03 +0300
committerbubnikv <bubnikv@gmail.com>2017-11-30 19:45:03 +0300
commita617e02ae667e49215ec577a7b0bfb9ccc2e0b3f (patch)
treeebcfcb206436c920347b77525d2cf546cc004b01 /lib
parentbff7065360bfa99fc9033db5a1c21b5186ecd17c (diff)
New hot key for auto arrange: 'a'.
Diffstat (limited to 'lib')
-rw-r--r--lib/Slic3r/GUI/Plater.pm1
-rw-r--r--lib/Slic3r/GUI/Plater/3D.pm11
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm
index a6915bb7c..35e40b83c 100644
--- a/lib/Slic3r/GUI/Plater.pm
+++ b/lib/Slic3r/GUI/Plater.pm
@@ -99,6 +99,7 @@ sub new {
$self->{canvas3D}->set_on_select_object($on_select_object);
$self->{canvas3D}->set_on_double_click($on_double_click);
$self->{canvas3D}->set_on_right_click(sub { $on_right_click->($self->{canvas3D}, @_); });
+ $self->{canvas3D}->set_on_arrange(sub { $self->arrange });
$self->{canvas3D}->set_on_rotate_object_left(sub { $self->rotate(-45, Z, 'relative') });
$self->{canvas3D}->set_on_rotate_object_right(sub { $self->rotate( 45, Z, 'relative') });
$self->{canvas3D}->set_on_scale_object_uniformly(sub { $self->changescale(undef) });
diff --git a/lib/Slic3r/GUI/Plater/3D.pm b/lib/Slic3r/GUI/Plater/3D.pm
index 503a3d159..1c123e741 100644
--- a/lib/Slic3r/GUI/Plater/3D.pm
+++ b/lib/Slic3r/GUI/Plater/3D.pm
@@ -9,7 +9,7 @@ use Wx::Event qw(EVT_KEY_DOWN EVT_CHAR);
use base qw(Slic3r::GUI::3DScene Class::Accessor);
__PACKAGE__->mk_accessors(qw(
- on_rotate_object_left on_rotate_object_right on_scale_object_uniformly
+ on_arrange on_rotate_object_left on_rotate_object_right on_scale_object_uniformly
on_remove_object on_increase_objects on_decrease_objects));
sub new {
@@ -88,7 +88,9 @@ sub new {
$event->Skip;
} else {
my $key = $event->GetKeyCode;
- if ($key == ord('l')) {
+ if ($key == ord('a')) {
+ $self->on_arrange->() if $self->on_arrange;
+ } elsif ($key == ord('l')) {
$self->on_rotate_object_left->() if $self->on_rotate_object_left;
} elsif ($key == ord('r')) {
$self->on_rotate_object_right->() if $self->on_rotate_object_right;
@@ -122,6 +124,11 @@ sub set_on_right_click {
$self->on_right_click($cb);
}
+sub set_on_arrange {
+ my ($self, $cb) = @_;
+ $self->on_arrange($cb);
+}
+
sub set_on_rotate_object_left {
my ($self, $cb) = @_;
$self->on_rotate_object_left($cb);