diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index 1bbffc92e6..8ed184fc4e 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -94,6 +94,7 @@ our $Settings = { tabbed_preset_editors => 1, show_host => 0, nudge_val => 1, + extended_gui => 0, reload_hide_dialog => 0, reload_behavior => 0 }, diff --git a/lib/Slic3r/GUI/ColorScheme.pm b/lib/Slic3r/GUI/ColorScheme.pm index dec1dc392b..6beca9f946 100644 --- a/lib/Slic3r/GUI/ColorScheme.pm +++ b/lib/Slic3r/GUI/ColorScheme.pm @@ -6,7 +6,7 @@ use POSIX; use vars qw(@ISA @EXPORT); use Exporter 'import'; our @ISA = 'Exporter'; -our @EXPORT = qw($DEFAULT_COLORSCHEME $SOLID_BACKGROUNDCOLOR @SELECTED_COLOR @HOVER_COLOR @TOP_COLOR @BOTTOM_COLOR @GRID_COLOR @GROUND_COLOR @COLOR_CUTPLANE @COLOR_PARTS @COLOR_INFILL @COLOR_SUPPORT @COLOR_UNKNOWN @BED_COLOR @BED_GRID @BED_SELECTED @BED_OBJECTS @BED_INSTANCE @BED_DRAGGED @BED_CENTER @BED_SKIRT @BED_CLEARANCE @BED_DARK @BACKGROUND255 @TOOL_DARK @TOOL_SUPPORT @TOOL_STEPPERIM @TOOL_INFILL @TOOL_SHADE @TOOL_COLOR @BACKGROUND_COLOR @SPLINE_L_PEN @SPLINE_O_PEN @SPLINE_I_PEN @SPLINE_R_PEN ); +our @EXPORT = qw($DEFAULT_COLORSCHEME $SOLID_BACKGROUNDCOLOR @SELECTED_COLOR @HOVER_COLOR @TOP_COLOR @BOTTOM_COLOR @GRID_COLOR @GROUND_COLOR @COLOR_CUTPLANE @COLOR_PARTS @COLOR_INFILL @COLOR_SUPPORT @COLOR_UNKNOWN @BED_COLOR @BED_GRID @BED_SELECTED @BED_OBJECTS @BED_INSTANCE @BED_DRAGGED @BED_CENTER @BED_SKIRT @BED_CLEARANCE @BED_DARK @BACKGROUND255 @TOOL_DARK @TOOL_SUPPORT @TOOL_STEPPERIM @TOOL_INFILL @TOOL_SHADE @TOOL_COLOR @BACKGROUND_COLOR @SPLINE_L_PEN @SPLINE_O_PEN @SPLINE_I_PEN @SPLINE_R_PEN @rotateX90cw @rotateX90ccw @rotateX180 @rotateY90cw @rotateY90ccw @rotateY180 @rotateZ90cw @rotateZ90ccw @rotateZ180 @rotate45cw @rotate45ccw @rotateX90cwT @rotateX90ccwT @rotateY90cwT @rotateY90ccwT @rotateZ90cwT @rotateZ90ccwT @rotateZ45cwT @rotateZ45ccwT @mirrorX @mirrorY @mirrorZ ); # DEFAULT values our $DEFAULT_COLORSCHEME = 1; @@ -45,6 +45,34 @@ our @SPLINE_I_PEN = (255, 0, 0); our @SPLINE_R_PEN = (5, 120, 160); our @BED_DARK = (0, 0, 0); +# ICONS for the Context Menu +our @rotateX90cw = "arrow_rotate_x_clockwise.png"; +our @rotateX90ccw = "arrow_rotate_x_anticlockwise.png"; +our @rotateX180 = "arrow_rotate_x_clockwise.png"; +our @rotateY90cw = "arrow_rotate_y_clockwise.png"; +our @rotateY90ccw = "arrow_rotate_y_anticlockwise.png"; +our @rotateY180 = "arrow_rotate_y_clockwise.png"; +our @rotateZ90cw = "arrow_rotate_z_clockwise.png"; +our @rotateZ90ccw = "arrow_rotate_z_anticlockwise.png"; +our @rotateZ180 = "arrow_rotate_z_clockwise.png"; +our @rotate45cw = "arrow_rotate_z_clockwise.png"; +our @rotate45ccw = "arrow_rotate_z_anticlockwise.png"; +our @mirrorX = 'shape_flip_horizontal_x.png'; +our @mirrorY = 'shape_flip_horizontal_y.png'; +our @mirrorZ = 'shape_flip_horizontal_z.png'; + +# ICONS for the Toolbar (might be different) +our @rotateX90cwT = "arrow_rotate_x_clockwise.png"; +our @rotateX90ccwT = "arrow_rotate_x_anticlockwise.png"; +our @rotateY90cwT = "arrow_rotate_y_clockwise.png"; +our @rotateY90ccwT = "arrow_rotate_y_anticlockwise.png"; +our @rotateZ90cwT = "arrow_rotate_z_clockwise.png"; +our @rotateZ90ccwT = "arrow_rotate_z_anticlockwise.png"; +our @rotateZ45cwT = "arrow_rotate_z_clockwise.png"; +our @rotateZ45ccwT = "arrow_rotate_z_anticlockwise.png"; + + + # S O L A R I Z E # # http://ethanschoonover.com/solarized our @COLOR_BASE03 = (0.00000,0.16863,0.21176); @@ -72,6 +100,12 @@ our @COLOR_GREEN = (0.52157,0.60000,0.00000); sub getSolarized { # add this name to Preferences.pm $DEFAULT_COLORSCHEME = 0; # DISABLE default color scheme $SOLID_BACKGROUNDCOLOR = 1; # Switch between SOLID or FADED background color + my $largeicons = 0; # Default: 0. 1 for large icons-set. + + if ($Slic3r::GUI::Settings->{_}{extended_gui} >= 4){ + $largeicons = 1; + } + @SELECTED_COLOR = @COLOR_MAGENTA; # Color of selected Model @HOVER_COLOR = @COLOR_VIOLET; # Color when hovering over Model # @TOP_COLOR = @COLOR_BASE2; # FADE Background color - only used if $SOLID_BACKGROUNDCOLOR = 0 @@ -112,6 +146,40 @@ sub getSolarized { # add this name to Preferences.pm @SPLINE_I_PEN = map { ceil($_ * 255) } @COLOR_MAGENTA; # Interactive color @SPLINE_R_PEN = map { ceil($_ * 255) } @COLOR_VIOLET; # Resulting color + if ($largeicons == 1){ # use large icons + # ICONS for the Toolbar (might be different) + our @rotateX90cwT = 'solarized/arrow_rotate_x_clockwise90.png'; + our @rotateX90ccwT = 'solarized/arrow_rotate_x_anticlockwise90.png'; + our @rotateY90cwT = 'solarized/arrow_rotate_y_clockwise90.png'; + our @rotateY90ccwT = 'solarized/arrow_rotate_y_anticlockwise90.png'; + our @rotateZ90cwT = 'solarized/arrow_rotate_z_clockwise90.png'; + our @rotateZ90ccwT = 'solarized/arrow_rotate_z_anticlockwise90.png'; + our @rotateZ45cwT = 'solarized/arrow_rotate_z_clockwise45.png'; + our @rotateZ45ccwT = 'solarized/arrow_rotate_z_anticlockwise45.png'; + } else { + # use default or small icons + our @rotateX90cwT = 'solarized/arrow_rotate_x_clockwise90_16.png'; + our @rotateX90ccwT = 'solarized/arrow_rotate_x_anticlockwise90_16.png'; + our @rotateY90cwT = 'solarized/arrow_rotate_y_clockwise90_16.png'; + our @rotateY90ccwT = 'solarized/arrow_rotate_y_anticlockwise90_16.png'; + our @rotateZ90cwT = 'solarized/arrow_rotate_z_clockwise90_16.png'; + our @rotateZ90ccwT = 'solarized/arrow_rotate_z_anticlockwise90_16.png'; + our @rotateZ45cwT = 'solarized/arrow_rotate_z_clockwise45_16.png'; + our @rotateZ45ccwT = 'solarized/arrow_rotate_z_anticlockwise45_16.png'; + } + + our @rotateX90cw = 'solarized/arrow_rotate_x_clockwise90_16.png'; + our @rotateX90ccw = 'solarized/arrow_rotate_x_anticlockwise90_16.png'; + our @rotateX180 = 'solarized/arrow_rotate_x_180_16.png'; + our @rotateY90cw = 'solarized/arrow_rotate_y_clockwise90_16.png'; + our @rotateY90ccw = 'solarized/arrow_rotate_y_anticlockwise90_16.png'; + our @rotateY180 = 'solarized/arrow_rotate_y_180_16.png'; + our @rotateZ90cw = 'solarized/arrow_rotate_z_clockwise90_16.png'; + our @rotateZ90ccw = 'solarized/arrow_rotate_z_anticlockwise90_16.png'; + our @rotateZ180 = 'solarized/arrow_rotate_z_180_16.png'; + our @rotate45cw = 'solarized/arrow_rotate_z_clockwise45_16.png'; + our @rotate45ccw = 'solarized/arrow_rotate_z_anticlockwise45_16.png'; + } sub getDefault{ diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 4c083bbfe4..f1d2cb735d 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -31,6 +31,7 @@ use Wx qw(:button :cursor :dialog :filedialog :keycode :icon :font :id :misc use Wx::Event qw(EVT_BUTTON EVT_COMMAND EVT_KEY_DOWN EVT_MOUSE_EVENTS EVT_PAINT EVT_TOOL EVT_CHOICE EVT_COMBOBOX EVT_TIMER EVT_NOTEBOOK_PAGE_CHANGED EVT_LEFT_UP EVT_CLOSE); use base qw(Wx::Panel Class::Accessor); +use Slic3r::GUI::ColorScheme; __PACKAGE__->mk_accessors(qw(presets)); @@ -42,6 +43,12 @@ use constant TB_EXPORT_GCODE => &Wx::NewId; use constant TB_EXPORT_STL => &Wx::NewId; use constant TB_MORE => &Wx::NewId; use constant TB_FEWER => &Wx::NewId; +use constant TB_X90CW => &Wx::NewId; +use constant TB_X90CCW => &Wx::NewId; +use constant TB_Y90CW => &Wx::NewId; +use constant TB_Y90CCW => &Wx::NewId; +use constant TB_Z90CW => &Wx::NewId; +use constant TB_Z90CCW => &Wx::NewId; use constant TB_45CW => &Wx::NewId; use constant TB_45CCW => &Wx::NewId; use constant TB_ROTFACE => &Wx::NewId; @@ -191,9 +198,22 @@ sub new { $self->{htoolbar}->AddTool(TB_MORE, "More", Wx::Bitmap->new($Slic3r::var->("add.png"), wxBITMAP_TYPE_PNG), ''); $self->{htoolbar}->AddTool(TB_FEWER, "Fewer", Wx::Bitmap->new($Slic3r::var->("delete.png"), wxBITMAP_TYPE_PNG), ''); $self->{htoolbar}->AddSeparator; - $self->{htoolbar}->AddTool(TB_45CCW, "45° ccw", Wx::Bitmap->new($Slic3r::var->("arrow_rotate_anticlockwise.png"), wxBITMAP_TYPE_PNG), ''); - $self->{htoolbar}->AddTool(TB_45CW, "45° cw", Wx::Bitmap->new($Slic3r::var->("arrow_rotate_clockwise.png"), wxBITMAP_TYPE_PNG), ''); + + if ($Slic3r::GUI::Settings->{_}{extended_gui} >= 2) { # if Toolbar enabled + $self->{htoolbar}->AddTool(TB_X90CCW, "90° X ccw", Wx::Bitmap->new(@rotateX90ccwT, wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_X90CW, "90° X cw", Wx::Bitmap->new(@rotateX90cwT, wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_Y90CCW, "90° Y ccw", Wx::Bitmap->new(@rotateY90ccwT, wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_Y90CW, "90° Y cw", Wx::Bitmap->new(@rotateY90cwT, wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_Z90CCW, "90° Z ccw", Wx::Bitmap->new(@rotateZ90ccwT, wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_Z90CW, "90° Z cw", Wx::Bitmap->new(@rotateZ90cwT, wxBITMAP_TYPE_PNG), ''); + } + + $self->{htoolbar}->AddTool(TB_45CCW, "45° ccw", Wx::Bitmap->new(@rotateZ45ccwT, wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_45CW, "45° cw", Wx::Bitmap->new(@rotateZ45cwT, wxBITMAP_TYPE_PNG), ''); $self->{htoolbar}->AddTool(TB_ROTFACE, "Rotate face", Wx::Bitmap->new($Slic3r::var->("rotate_face.png"), wxBITMAP_TYPE_PNG), ''); + + $self->{htoolbar}->AddSeparator; + $self->{htoolbar}->AddTool(TB_SCALE, "Scale…", Wx::Bitmap->new($Slic3r::var->("arrow_out.png"), wxBITMAP_TYPE_PNG), ''); $self->{htoolbar}->AddTool(TB_SPLIT, "Split", Wx::Bitmap->new($Slic3r::var->("shape_ungroup.png"), wxBITMAP_TYPE_PNG), ''); $self->{htoolbar}->AddTool(TB_CUT, "Cut…", Wx::Bitmap->new($Slic3r::var->("package.png"), wxBITMAP_TYPE_PNG), ''); @@ -208,8 +228,14 @@ sub new { arrange => "Arrange", increase => "", decrease => "", - rotate45ccw => "", - rotate45cw => "", + rotateX90ccw => "", + rotateX90cw => "", + rotateY90ccw => "", + rotateY90cw => "", + rotateZ90ccw => "", + rotateZ90cw => "", + rotateZ45ccw => "", + rotateZ45cw => "", rotateFace => "", changescale => "Scale…", split => "Split", @@ -217,10 +243,43 @@ sub new { layers => "Layer heights…", settings => "Settings…", ); + my %tbar_buttonsToolTip = ( + add => "Adds new Objects", + remove => "Delete Object", + reset => "Clears the Plate of all Objects", + arrange => "Automaitally arrange Objects", + increase => "Add another Copy", + decrease => "Remove a Copy", + rotateX90ccw => "Rotate around X by 90° counter clockwise", + rotateX90cw => "Rotate around X by 90° clockwise", + rotateY90ccw => "Rotate around Y by 90° counter clockwise", + rotateY90cw => "Rotate around Y by 90° clockwise", + rotateZ90ccw => "Rotate around Z by 90° counter clockwise", + rotateZ90cw => "Rotate around Z by 90° clockwise", + rotateZ45ccw => "Rotate around Z by 45° counter clockwise", + rotateZ45cw => "Rotate around Z by 45° clockwise", + rotateFace => "Rotate to Face", + changescale => "Change Scale of Object", + split => "Split Object", + cut => "Cut Object", + settings => "Settings, Parts, Modifiers and Layers", + ); $self->{btoolbar} = Wx::BoxSizer->new(wxHORIZONTAL); - for (qw(add remove reset arrange increase decrease rotate45ccw rotate45cw rotateFace changescale split cut layers settings)) { - $self->{"btn_$_"} = Wx::Button->new($self, -1, $tbar_buttons{$_}, wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); - $self->{btoolbar}->Add($self->{"btn_$_"}); + + + if ($Slic3r::GUI::Settings->{_}{extended_gui} >= 2) { # if Toolbar enabled + for (qw(add remove reset arrange increase decrease rotateX90ccw rotateX90cw rotateY90ccw rotateY90cw rotateZ90ccw rotateZ90cw rotateZ45ccw rotateZ45cw changescale split cut settings)) { + $self->{"btn_$_"} = Wx::Button->new($self, -1, $tbar_buttons{$_}, wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); + $self->{btoolbar}->Add($self->{"btn_$_"}); + $self->{"btn_$_"}->SetToolTipString($tbar_buttonsToolTip{$_}); + } + } else { + for (qw(add remove reset arrange increase decrease rotateZ45ccw rotateZ45cw rotateFace changescale split cut settings)) { + $self->{"btn_$_"} = Wx::Button->new($self, -1, $tbar_buttons{$_}, wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); + $self->{btoolbar}->Add($self->{"btn_$_"}); + $self->{"btn_$_"}->SetToolTipString($tbar_buttonsToolTip{$_}); + } + } } @@ -235,26 +294,36 @@ sub new { $self->{btn_send_gcode}->Hide; if ($Slic3r::GUI::have_button_icons) { - my %icons = qw( - add brick_add.png - remove brick_delete.png - reset cross.png - arrange bricks.png - export_gcode cog_go.png - print arrow_up.png - send_gcode arrow_up.png - export_stl brick_go.png + my %icons = ( + add => "brick_add.png", + remove => "brick_delete.png", + reset => "cross.png", + arrange => "bricks.png", + export_gcode => "cog_go.png", + print => "arrow_up.png", + send_gcode => "arrow_up.png", + export_stl => "brick_go.png", - increase add.png - decrease delete.png - rotate45cw arrow_rotate_clockwise.png - rotate45ccw arrow_rotate_anticlockwise.png - rotateFace rotate_face.png - changescale arrow_out.png - split shape_ungroup.png - cut package.png - layers variable_layer_height.png - settings cog.png + increase => "add.png", + decrease => "delete.png", + + + rotateX90cw => @rotateX90cwT, + rotateX90ccw => @rotateX90ccwT, + rotateY90cw => @rotateY90cwT, + rotateY90ccw => @rotateY90ccwT, + rotateZ90cw => @rotateZ90cwT, + rotateZ90ccw => @rotateZ90ccwT, + rotateZ45cw => @rotateZ45cwT, + rotateZ45ccw => @rotateZ45ccwT, + + rotateFace => "rotate_face.png", + changescale => "arrow_out.png", + split => "shape_ungroup.png", + cut => "package.png", + layers => "variable_layer_height.png", + settings => "cog.png", + ); for (grep $self->{"btn_$_"}, keys %icons) { $self->{"btn_$_"}->SetBitmap(Wx::Bitmap->new($Slic3r::var->($icons{$_}), wxBITMAP_TYPE_PNG)); @@ -285,9 +354,18 @@ sub new { EVT_TOOL($self, TB_ARRANGE, sub { $self->arrange; }); EVT_TOOL($self, TB_MORE, sub { $self->increase; }); EVT_TOOL($self, TB_FEWER, sub { $self->decrease; }); - EVT_TOOL($self, TB_45CW, sub { $_[0]->rotate(-45) }); - EVT_TOOL($self, TB_45CCW, sub { $_[0]->rotate(45) }); + if ($Slic3r::GUI::Settings->{_}{extended_gui} >= 2) { # if Toolbar enabled + EVT_TOOL($self, TB_X90CW, sub { $_[0]->rotate(-90, X) }); + EVT_TOOL($self, TB_X90CCW, sub { $_[0]->rotate(90, X) }); + EVT_TOOL($self, TB_Y90CW, sub { $_[0]->rotate(-90, Y) }); + EVT_TOOL($self, TB_Y90CCW, sub { $_[0]->rotate(90, Y) }); + EVT_TOOL($self, TB_Z90CW, sub { $_[0]->rotate(-90, Z) }); + EVT_TOOL($self, TB_Z90CCW, sub { $_[0]->rotate(90, Z) }); + } + EVT_TOOL($self, TB_45CW, sub { $_[0]->rotate(-45, Z) }); + EVT_TOOL($self, TB_45CCW, sub { $_[0]->rotate(45, Z) }); EVT_TOOL($self, TB_ROTFACE, sub { $_[0]->rotate_face }); + EVT_TOOL($self, TB_SCALE, sub { $self->changescale(undef); }); EVT_TOOL($self, TB_SPLIT, sub { $self->split_object; }); EVT_TOOL($self, TB_CUT, sub { $_[0]->object_cut_dialog }); @@ -300,9 +378,22 @@ sub new { EVT_BUTTON($self, $self->{btn_arrange}, sub { $self->arrange; }); EVT_BUTTON($self, $self->{btn_increase}, sub { $self->increase; }); EVT_BUTTON($self, $self->{btn_decrease}, sub { $self->decrease; }); + + if ($Slic3r::GUI::Settings->{_}{extended_gui} >= 2) { # if Toolbar enabled + EVT_BUTTON($self, $self->{btn_rotateX90cw}, sub { $_[0]->rotate(-90, X) }); + EVT_BUTTON($self, $self->{btn_rotateX90ccw}, sub { $_[0]->rotate(90, X) }); + EVT_BUTTON($self, $self->{btn_rotateY90cw}, sub { $_[0]->rotate(-90, Y) }); + EVT_BUTTON($self, $self->{btn_rotateY90ccw}, sub { $_[0]->rotate(90, Y) }); + EVT_BUTTON($self, $self->{btn_rotateZ90cw}, sub { $_[0]->rotate(-90, Z) }); + EVT_BUTTON($self, $self->{btn_rotateZ90ccw}, sub { $_[0]->rotate(90, Z) }); + } + EVT_BUTTON($self, $self->{btn_rotateZ45cw}, sub { $_[0]->rotate(-45, Z) }); + EVT_BUTTON($self, $self->{btn_rotateZ45ccw}, sub { $_[0]->rotate(45, Z) }); + EVT_BUTTON($self, $self->{btn_rotateFace}, sub { $_[0]->rotate_face }); + EVT_BUTTON($self, $self->{btn_rotate45cw}, sub { $_[0]->rotate(-45) }); EVT_BUTTON($self, $self->{btn_rotate45ccw}, sub { $_[0]->rotate(45) }); - EVT_BUTTON($self, $self->{btn_rotateFace}, sub { $_[0]->rotate_face }); + EVT_BUTTON($self, $self->{btn_changescale}, sub { $self->changescale(undef); }); EVT_BUTTON($self, $self->{btn_split}, sub { $self->split_object; }); EVT_BUTTON($self, $self->{btn_cut}, sub { $_[0]->object_cut_dialog }); @@ -2939,11 +3030,11 @@ sub selection_changed { my $method = $have_sel ? 'Enable' : 'Disable'; $self->{"btn_$_"}->$method - for grep $self->{"btn_$_"}, qw(remove increase decrease rotate45cw rotate45ccw rotateFace changescale split cut layers settings); + for grep $self->{"btn_$_"}, qw(remove increase decrease rotateX90cw rotateX90ccw rotateY90cw rotateY90ccw rotateZ90cw rotateZ90ccw rotateZ45cw rotateZ45ccw rotateFace changescale split cut layers settings); if ($self->{htoolbar}) { $self->{htoolbar}->EnableTool($_, $have_sel) - for (TB_REMOVE, TB_MORE, TB_FEWER, TB_45CW, TB_45CCW, TB_ROTFACE, TB_SCALE, TB_SPLIT, TB_CUT, TB_LAYERS, TB_SETTINGS); + for (TB_REMOVE, TB_MORE, TB_FEWER, TB_X90CW, TB_X90CCW, TB_Y90CW, TB_Y90CCW, TB_Z90CW, TB_Z90CCW, TB_45CW, TB_45CCW, TB_ROTFACE, TB_SCALE, TB_SPLIT, TB_CUT, TB_LAYERS, TB_SETTINGS); } if ($self->{object_info_size}) { # have we already loaded the info pane? @@ -3085,46 +3176,124 @@ sub object_menu { wxTheApp->append_menu_item($menu, "Set number of copies…", 'Change the number of copies of the selected object', sub { $self->set_number_of_copies; }, undef, 'textfield.png'); - $menu->AppendSeparator(); - wxTheApp->append_menu_item($menu, "Move to bed center", 'Center object around bed center', sub { - $self->center_selected_object_on_bed; - }, undef, 'arrow_in.png'); - wxTheApp->append_menu_item($menu, "Rotate 45° clockwise", 'Rotate the selected object by 45° clockwise', sub { - $self->rotate(-45); - }, undef, 'arrow_rotate_clockwise.png'); - wxTheApp->append_menu_item($menu, "Rotate 45° counter-clockwise", 'Rotate the selected object by 45° counter-clockwise', sub { - $self->rotate(+45); - }, undef, 'arrow_rotate_anticlockwise.png'); + + if (!$Slic3r::GUI::Settings->{_}{autocenter}){ + $menu->AppendSeparator(); + wxTheApp->append_menu_item($menu, "Move to bed center", 'Center object around bed center', sub { + $self->center_selected_object_on_bed; + }, undef, 'arrow_in.png'); + } + if ($Slic3r::GUI::Settings->{_}{extended_gui} == 1 or $Slic3r::GUI::Settings->{_}{extended_gui} == 3 or $Slic3r::GUI::Settings->{_}{extended_gui} == 5){ # if context enabled + $menu->AppendSeparator(); + if ($Slic3r::GUI::Settings->{_}{extended_gui} == 1) { + wxTheApp->append_menu_item($menu, "Rotate 90° clockwise (X)", 'Rotate the selected object by 90° clockwise', sub { + $self->rotate(-90, X); + }, undef, @rotateX90cw); + wxTheApp->append_menu_item($menu, "Rotate 90° counter clockwise (X)", 'Rotate the selected object by 90° counter clockwise', sub { + $self->rotate(90, X); + }, undef, @rotateX90ccw); + wxTheApp->append_menu_item($menu, "Rotate 180° (X)", 'Rotate the selected object by 180°', sub { + $self->rotate(180, X); + }, undef, @rotateX180); + } elsif ($Slic3r::GUI::Settings->{_}{extended_gui} > 1) { + wxTheApp->append_menu_item($menu, "Rotate 180° (X)", 'Rotate the selected object by 180°', sub { + $self->rotate(180, X); + }, undef, @rotateX180); + wxTheApp->append_menu_item($menu, "Rotate around X axis…", 'Rotate the selected object by an arbitrary angle around X axis', sub { + $self->rotate(undef, X); + }, undef, @rotateX90ccw); + wxTheApp->append_menu_item($menu, "Mirror along X axis", 'Mirror the selected object along the X axis', sub { + $self->mirror(X); + }, undef, @mirrorX); + } + $menu->AppendSeparator(); + if ($Slic3r::GUI::Settings->{_}{extended_gui} == 1) { + wxTheApp->append_menu_item($menu, "Rotate 90° clockwise (Y)", 'Rotate the selected object by 90° clockwise', sub { + $self->rotate(-90, Y); + }, undef, @rotateY90cw); + wxTheApp->append_menu_item($menu, "Rotate 90° counter clockwise (Y)", 'Rotate the selected object by 90° counter clockwise', sub { + $self->rotate(90, Y); + }, undef, @rotateY90ccw); + wxTheApp->append_menu_item($menu, "Rotate 180° (Y)", 'Rotate the selected object by 180°', sub { + $self->rotate(180, Y); + }, undef, @rotateY180); + } elsif ($Slic3r::GUI::Settings->{_}{extended_gui} > 1) { + wxTheApp->append_menu_item($menu, "Rotate 180° (Y)", 'Rotate the selected object by 180°', sub { + $self->rotate(180, Y); + }, undef, @rotateY180); + wxTheApp->append_menu_item($menu, "Rotate around Y axis…", 'Rotate the selected object by an arbitrary angle around Y axis', sub { + $self->rotate(undef, Y); + }, undef, @rotateY90ccw); + wxTheApp->append_menu_item($menu, "Mirror along Y axis", 'Mirror the selected object along the Y axis', sub { + $self->mirror(Y); + }, undef, @mirrorY); + } + $menu->AppendSeparator(); + if ($Slic3r::GUI::Settings->{_}{extended_gui} == 1) { + wxTheApp->append_menu_item($menu, "Rotate 90° clockwise (Z)", 'Rotate the selected object by 90° clockwise', sub { + $self->rotate(-90, Z); + }, undef, @rotateZ90cw); + wxTheApp->append_menu_item($menu, "Rotate 90° counter clockwise (Z)", 'Rotate the selected object by 90° counter clockwise', sub { + $self->rotate(90, Z); + }, undef, @rotateZ90ccw); + wxTheApp->append_menu_item($menu, "Rotate 180° (Z)", 'Rotate the selected object by 180°', sub { + $self->rotate(180, Z); + }, undef, @rotateZ180); + } elsif ($Slic3r::GUI::Settings->{_}{extended_gui} > 1) { + wxTheApp->append_menu_item($menu, "Rotate 180° (Z)", 'Rotate the selected object by 180°', sub { + $self->rotate(180, Z); + }, undef, @rotateZ180); + wxTheApp->append_menu_item($menu, "Rotate around Z axis…", 'Rotate the selected object by an arbitrary angle around Z axis', sub { + $self->rotate(undef, Z); + }, undef, @rotateZ90ccw); + wxTheApp->append_menu_item($menu, "Mirror along Z axis", 'Mirror the selected object along the Z axis', sub { + $self->mirror(Z); + }, undef, @mirrorZ); + } + } else { + wxTheApp->append_menu_item($menu, "Rotate 45° clockwise (Z))", 'Rotate the selected object by 45° clockwise', sub { + $self->rotate(-45, Z); + }, undef, @rotateZ90cw); + wxTheApp->append_menu_item($menu, "Rotate 45° counter clockwise (Z))", 'Rotate the selected object by 45° counter clockwise', sub { + $self->rotate(+45, Z); + }, undef, @rotateZ90ccw); + + } wxTheApp->append_menu_item($menu, "Rotate Face to Plane", 'Rotates the selected object to have the selected face parallel with a plane', sub { $self->rotate_face; }, undef, 'rotate_face.png'); + $menu->AppendSeparator(); - { - my $rotateMenu = Wx::Menu->new; - wxTheApp->append_menu_item($rotateMenu, "Around X axis…", 'Rotate the selected object by an arbitrary angle around X axis', sub { - $self->rotate(undef, X); - }, undef, 'bullet_red.png'); - wxTheApp->append_menu_item($rotateMenu, "Around Y axis…", 'Rotate the selected object by an arbitrary angle around Y axis', sub { - $self->rotate(undef, Y); - }, undef, 'bullet_green.png'); - wxTheApp->append_menu_item($rotateMenu, "Around Z axis…", 'Rotate the selected object by an arbitrary angle around Z axis', sub { - $self->rotate(undef, Z); - }, undef, 'bullet_blue.png'); - wxTheApp->append_submenu($menu, "Rotate", 'Rotate the selected object by an arbitrary angle', $rotateMenu, undef, 'textfield.png'); - } - - { - my $mirrorMenu = Wx::Menu->new; - wxTheApp->append_menu_item($mirrorMenu, "Along X axis…", 'Mirror the selected object along the X axis', sub { - $self->mirror(X); - }, undef, 'bullet_red.png'); - wxTheApp->append_menu_item($mirrorMenu, "Along Y axis…", 'Mirror the selected object along the Y axis', sub { - $self->mirror(Y); - }, undef, 'bullet_green.png'); - wxTheApp->append_menu_item($mirrorMenu, "Along Z axis…", 'Mirror the selected object along the Z axis', sub { - $self->mirror(Z); - }, undef, 'bullet_blue.png'); - wxTheApp->append_submenu($menu, "Mirror", 'Mirror the selected object', $mirrorMenu, undef, 'shape_flip_horizontal.png'); + # Extended GUI: + # only at option 0,2,4 + if ($Slic3r::GUI::Settings->{_}{extended_gui} == 0 or $Slic3r::GUI::Settings->{_}{extended_gui} == 2 or $Slic3r::GUI::Settings->{_}{extended_gui} == 4){ + { + my $rotateMenu = Wx::Menu->new; + wxTheApp->append_menu_item($rotateMenu, "Around X axis…", 'Rotate the selected object by an arbitrary angle around X axis', sub { + $self->rotate(undef, X); + }, undef, @rotateX90ccw); + wxTheApp->append_menu_item($rotateMenu, "Around Y axis…", 'Rotate the selected object by an arbitrary angle around Y axis', sub { + $self->rotate(undef, Y); + }, undef, @rotateY90ccw); + wxTheApp->append_menu_item($rotateMenu, "Around Z axis…", 'Rotate the selected object by an arbitrary angle around Z axis', sub { + $self->rotate(undef, Z); + }, undef, @rotateZ90ccw); + wxTheApp->append_submenu($menu, "Rotate", 'Rotate the selected object by an arbitrary angle', $rotateMenu, undef, 'textfield.png'); + } + + { + my $mirrorMenu = Wx::Menu->new; + wxTheApp->append_menu_item($mirrorMenu, "Along X axis", 'Mirror the selected object along the X axis', sub { + $self->mirror(X); + }, undef, @mirrorX); + wxTheApp->append_menu_item($mirrorMenu, "Along Y axis", 'Mirror the selected object along the Y axis', sub { + $self->mirror(Y); + }, undef, @mirrorY); + wxTheApp->append_menu_item($mirrorMenu, "Along Z axis", 'Mirror the selected object along the Z axis', sub { + $self->mirror(Z); + }, undef, @mirrorZ); + wxTheApp->append_submenu($menu, "Mirror", 'Mirror the selected object', $mirrorMenu, undef, 'shape_flip_horizontal.png'); + } } { diff --git a/lib/Slic3r/GUI/Preferences.pm b/lib/Slic3r/GUI/Preferences.pm index e63ca8cbc8..117a2f0c84 100644 --- a/lib/Slic3r/GUI/Preferences.pm +++ b/lib/Slic3r/GUI/Preferences.pm @@ -109,6 +109,16 @@ sub new { default => $Slic3r::GUI::Settings->{_}{reload_behavior}, width => 180, )); + $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( # Extended GUI - Context and/or Toolbar + opt_id => 'extended_gui', + type => 'select', + label => 'Extended GUI: ', + tooltip => 'Choose extended rotate commands in the toolbar and/or in the context menu. If you don\'t use the default color scheme, the themed icons for the toolbar will be used. Requires a restart of Slic3r.', + labels => ['Default', 'Context only', 'Toolbar only', 'Toolbar and Context', 'Toolbar only (big)', 'Toolbar (big) and Context'], + values => [0, 1, 2, 3, 4, 5], + default => $Slic3r::GUI::Settings->{_}{extended_gui}, + width => 180, + )); $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( # colorscheme opt_id => 'colorscheme', type => 'select', @@ -116,7 +126,7 @@ sub new { tooltip => 'Choose between color schemes - restart of Slic3r required.', labels => ['Default','Solarized'], # add more schemes, if you want in ColorScheme.pm. values => ['getDefault','getSolarized'], # add more schemes, if you want - those are the names of the corresponding function in ColorScheme.pm. - default => $Slic3r::GUI::Settings->{_}{colorscheme} // 'getDefault', + default => $Slic3r::GUI::Settings->{_}{colorscheme}, width => 180, )); diff --git a/var/arrow_rotate_x_anticlockwise.png b/var/arrow_rotate_x_anticlockwise.png new file mode 100644 index 0000000000..d3c26fa04e Binary files /dev/null and b/var/arrow_rotate_x_anticlockwise.png differ diff --git a/var/arrow_rotate_x_clockwise.png b/var/arrow_rotate_x_clockwise.png new file mode 100644 index 0000000000..3caf237551 Binary files /dev/null and b/var/arrow_rotate_x_clockwise.png differ diff --git a/var/arrow_rotate_y_anticlockwise.png b/var/arrow_rotate_y_anticlockwise.png new file mode 100644 index 0000000000..abc7535df6 Binary files /dev/null and b/var/arrow_rotate_y_anticlockwise.png differ diff --git a/var/arrow_rotate_y_clockwise.png b/var/arrow_rotate_y_clockwise.png new file mode 100644 index 0000000000..8624dfd114 Binary files /dev/null and b/var/arrow_rotate_y_clockwise.png differ diff --git a/var/arrow_rotate_z_anticlockwise.png b/var/arrow_rotate_z_anticlockwise.png new file mode 100644 index 0000000000..5f497694fc Binary files /dev/null and b/var/arrow_rotate_z_anticlockwise.png differ diff --git a/var/arrow_rotate_z_clockwise.png b/var/arrow_rotate_z_clockwise.png new file mode 100644 index 0000000000..4547c480e8 Binary files /dev/null and b/var/arrow_rotate_z_clockwise.png differ diff --git a/var/shape_flip_horizontal_x.png b/var/shape_flip_horizontal_x.png new file mode 100644 index 0000000000..b66a312426 Binary files /dev/null and b/var/shape_flip_horizontal_x.png differ diff --git a/var/shape_flip_horizontal_y.png b/var/shape_flip_horizontal_y.png new file mode 100644 index 0000000000..1676f0f65b Binary files /dev/null and b/var/shape_flip_horizontal_y.png differ diff --git a/var/shape_flip_horizontal_z.png b/var/shape_flip_horizontal_z.png new file mode 100644 index 0000000000..8667c81f8b Binary files /dev/null and b/var/shape_flip_horizontal_z.png differ diff --git a/var/solarized/arrow_rotate_x_180.png b/var/solarized/arrow_rotate_x_180.png new file mode 100644 index 0000000000..a8b5a55e91 Binary files /dev/null and b/var/solarized/arrow_rotate_x_180.png differ diff --git a/var/solarized/arrow_rotate_x_180_16.png b/var/solarized/arrow_rotate_x_180_16.png new file mode 100644 index 0000000000..e11a3fb7ea Binary files /dev/null and b/var/solarized/arrow_rotate_x_180_16.png differ diff --git a/var/solarized/arrow_rotate_x_anticlockwise90.png b/var/solarized/arrow_rotate_x_anticlockwise90.png new file mode 100644 index 0000000000..8c7f984fa7 Binary files /dev/null and b/var/solarized/arrow_rotate_x_anticlockwise90.png differ diff --git a/var/solarized/arrow_rotate_x_anticlockwise90_16.png b/var/solarized/arrow_rotate_x_anticlockwise90_16.png new file mode 100644 index 0000000000..9fc9eb0bbc Binary files /dev/null and b/var/solarized/arrow_rotate_x_anticlockwise90_16.png differ diff --git a/var/solarized/arrow_rotate_x_clockwise90.png b/var/solarized/arrow_rotate_x_clockwise90.png new file mode 100644 index 0000000000..d2e2524de6 Binary files /dev/null and b/var/solarized/arrow_rotate_x_clockwise90.png differ diff --git a/var/solarized/arrow_rotate_x_clockwise90_16.png b/var/solarized/arrow_rotate_x_clockwise90_16.png new file mode 100644 index 0000000000..d685543af2 Binary files /dev/null and b/var/solarized/arrow_rotate_x_clockwise90_16.png differ diff --git a/var/solarized/arrow_rotate_y_180.png b/var/solarized/arrow_rotate_y_180.png new file mode 100644 index 0000000000..c8277c6fff Binary files /dev/null and b/var/solarized/arrow_rotate_y_180.png differ diff --git a/var/solarized/arrow_rotate_y_180_16.png b/var/solarized/arrow_rotate_y_180_16.png new file mode 100644 index 0000000000..3f4bd0ba77 Binary files /dev/null and b/var/solarized/arrow_rotate_y_180_16.png differ diff --git a/var/solarized/arrow_rotate_y_anticlockwise90.png b/var/solarized/arrow_rotate_y_anticlockwise90.png new file mode 100644 index 0000000000..593e29738c Binary files /dev/null and b/var/solarized/arrow_rotate_y_anticlockwise90.png differ diff --git a/var/solarized/arrow_rotate_y_anticlockwise90_16.png b/var/solarized/arrow_rotate_y_anticlockwise90_16.png new file mode 100644 index 0000000000..efac6b49f9 Binary files /dev/null and b/var/solarized/arrow_rotate_y_anticlockwise90_16.png differ diff --git a/var/solarized/arrow_rotate_y_clockwise90.png b/var/solarized/arrow_rotate_y_clockwise90.png new file mode 100644 index 0000000000..a651578448 Binary files /dev/null and b/var/solarized/arrow_rotate_y_clockwise90.png differ diff --git a/var/solarized/arrow_rotate_y_clockwise90_16.png b/var/solarized/arrow_rotate_y_clockwise90_16.png new file mode 100644 index 0000000000..82edac4954 Binary files /dev/null and b/var/solarized/arrow_rotate_y_clockwise90_16.png differ diff --git a/var/solarized/arrow_rotate_z_180.png b/var/solarized/arrow_rotate_z_180.png new file mode 100644 index 0000000000..7057f3899c Binary files /dev/null and b/var/solarized/arrow_rotate_z_180.png differ diff --git a/var/solarized/arrow_rotate_z_180_16.png b/var/solarized/arrow_rotate_z_180_16.png new file mode 100644 index 0000000000..29c2ccbc6e Binary files /dev/null and b/var/solarized/arrow_rotate_z_180_16.png differ diff --git a/var/solarized/arrow_rotate_z_anticlockwise45.png b/var/solarized/arrow_rotate_z_anticlockwise45.png new file mode 100644 index 0000000000..b29692f5ff Binary files /dev/null and b/var/solarized/arrow_rotate_z_anticlockwise45.png differ diff --git a/var/solarized/arrow_rotate_z_anticlockwise45_16.png b/var/solarized/arrow_rotate_z_anticlockwise45_16.png new file mode 100644 index 0000000000..eaeb8a2af9 Binary files /dev/null and b/var/solarized/arrow_rotate_z_anticlockwise45_16.png differ diff --git a/var/solarized/arrow_rotate_z_anticlockwise90.png b/var/solarized/arrow_rotate_z_anticlockwise90.png new file mode 100644 index 0000000000..a78b1b96c1 Binary files /dev/null and b/var/solarized/arrow_rotate_z_anticlockwise90.png differ diff --git a/var/solarized/arrow_rotate_z_anticlockwise90_16.png b/var/solarized/arrow_rotate_z_anticlockwise90_16.png new file mode 100644 index 0000000000..f439d71788 Binary files /dev/null and b/var/solarized/arrow_rotate_z_anticlockwise90_16.png differ diff --git a/var/solarized/arrow_rotate_z_clockwise45.png b/var/solarized/arrow_rotate_z_clockwise45.png new file mode 100644 index 0000000000..70a7fa5b2f Binary files /dev/null and b/var/solarized/arrow_rotate_z_clockwise45.png differ diff --git a/var/solarized/arrow_rotate_z_clockwise45_16.png b/var/solarized/arrow_rotate_z_clockwise45_16.png new file mode 100644 index 0000000000..3d98b0aba6 Binary files /dev/null and b/var/solarized/arrow_rotate_z_clockwise45_16.png differ diff --git a/var/solarized/arrow_rotate_z_clockwise90.png b/var/solarized/arrow_rotate_z_clockwise90.png new file mode 100644 index 0000000000..9e7f01a2b5 Binary files /dev/null and b/var/solarized/arrow_rotate_z_clockwise90.png differ diff --git a/var/solarized/arrow_rotate_z_clockwise90_16.png b/var/solarized/arrow_rotate_z_clockwise90_16.png new file mode 100644 index 0000000000..0295f78c9a Binary files /dev/null and b/var/solarized/arrow_rotate_z_clockwise90_16.png differ