Hopefuly a fix of https://github.com/prusa3d/Slic3r/issues/116
Enabling / disabling of the layer editing button on OSX & linux did not work.
This commit is contained in:
parent
e2f8ea2809
commit
fd54956d70
@ -1636,15 +1636,24 @@ sub on_config_change {
|
||||
$self->Layout;
|
||||
} elsif ($opt_key eq 'variable_layer_height') {
|
||||
if ($config->get('variable_layer_height') != 1) {
|
||||
if ($self->{htoolbar}) {
|
||||
$self->{htoolbar}->EnableTool(TB_LAYER_EDITING, 0);
|
||||
$self->{htoolbar}->ToggleTool(TB_LAYER_EDITING, 0);
|
||||
} else {
|
||||
$self->{"btn_layer_editing"}->Disable;
|
||||
$self->{"btn_layer_editing"}->SetValue(0);
|
||||
}
|
||||
$self->{canvas3D}->layer_editing_enabled(0);
|
||||
$self->{canvas3D}->update;
|
||||
} else {
|
||||
if ($self->{htoolbar}) {
|
||||
$self->{htoolbar}->EnableTool(TB_LAYER_EDITING, 1);
|
||||
} else {
|
||||
$self->{"btn_layer_editing"}->Enable;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return if !$self->GetFrame->is_loaded;
|
||||
|
||||
@ -1749,10 +1758,18 @@ sub object_list_changed {
|
||||
|
||||
# Enable/disable buttons depending on whether there are any objects on the platter.
|
||||
my $have_objects = @{$self->{objects}} ? 1 : 0;
|
||||
if ($self->{htoolbar}) {
|
||||
# On OSX or Linux
|
||||
$self->{htoolbar}->EnableTool($_, $have_objects)
|
||||
for (TB_RESET, TB_ARRANGE, TB_LAYER_EDITING);
|
||||
$self->{htoolbar}->EnableTool(TB_LAYER_EDITING, 0) if (! $self->{config}->variable_layer_height);
|
||||
} else {
|
||||
# On MSW
|
||||
my $method = $have_objects ? 'Enable' : 'Disable';
|
||||
$self->{"btn_$_"}->$method
|
||||
for grep $self->{"btn_$_"}, qw(reset arrange reslice export_gcode export_stl print send_gcode layer_editing);
|
||||
$self->{"btn_layer_editing"}->Disable if (! $self->{config}->variable_layer_height);
|
||||
}
|
||||
|
||||
if ($self->{export_gcode_output_file} || $self->{send_gcode_file}) {
|
||||
$self->{btn_reslice}->Disable;
|
||||
@ -1760,11 +1777,6 @@ sub object_list_changed {
|
||||
$self->{btn_print}->Disable;
|
||||
$self->{btn_send_gcode}->Disable;
|
||||
}
|
||||
|
||||
if ($self->{htoolbar}) {
|
||||
$self->{htoolbar}->EnableTool($_, $have_objects)
|
||||
for (TB_RESET, TB_ARRANGE);
|
||||
}
|
||||
}
|
||||
|
||||
sub selection_changed {
|
||||
@ -1773,13 +1785,15 @@ sub selection_changed {
|
||||
my ($obj_idx, $object) = $self->selected_object;
|
||||
my $have_sel = defined $obj_idx;
|
||||
|
||||
if ($self->{htoolbar}) {
|
||||
# On OSX or Linux
|
||||
$self->{htoolbar}->EnableTool($_, $have_sel)
|
||||
for (TB_REMOVE, TB_MORE, TB_FEWER, TB_45CW, TB_45CCW, TB_SCALE, TB_SPLIT, TB_CUT, TB_SETTINGS);
|
||||
} else {
|
||||
# On MSW
|
||||
my $method = $have_sel ? 'Enable' : 'Disable';
|
||||
$self->{"btn_$_"}->$method
|
||||
for grep $self->{"btn_$_"}, qw(remove increase decrease rotate45cw rotate45ccw changescale split cut settings);
|
||||
|
||||
if ($self->{htoolbar}) {
|
||||
$self->{htoolbar}->EnableTool($_, $have_sel)
|
||||
for (TB_REMOVE, TB_MORE, TB_FEWER, TB_45CW, TB_45CCW, TB_SCALE, TB_SPLIT, TB_CUT, TB_SETTINGS);
|
||||
}
|
||||
|
||||
if ($self->{object_info_size}) { # have we already loaded the info pane?
|
||||
|
Loading…
Reference in New Issue
Block a user