mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 21:25:53 +08:00
Disable Plater menu when there are no objects in plater
This commit is contained in:
parent
1a788196fa
commit
9895885ba5
@ -194,6 +194,7 @@ sub _init_menubar {
|
|||||||
}, undef, 'brick_go.png');
|
}, undef, 'brick_go.png');
|
||||||
|
|
||||||
$self->{object_menu} = $self->{plater}->object_menu;
|
$self->{object_menu} = $self->{plater}->object_menu;
|
||||||
|
$self->on_plater_object_list_changed(0);
|
||||||
$self->on_plater_selection_changed(0);
|
$self->on_plater_selection_changed(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,6 +310,14 @@ sub is_loaded {
|
|||||||
return $self->{loaded};
|
return $self->{loaded};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub on_plater_object_list_changed {
|
||||||
|
my ($self, $have_objects) = @_;
|
||||||
|
|
||||||
|
return if !defined $self->{plater_menu};
|
||||||
|
$self->{plater_menu}->Enable($_->GetId, $have_objects)
|
||||||
|
for $self->{plater_menu}->GetMenuItems;
|
||||||
|
}
|
||||||
|
|
||||||
sub on_plater_selection_changed {
|
sub on_plater_selection_changed {
|
||||||
my ($self, $have_selection) = @_;
|
my ($self, $have_selection) = @_;
|
||||||
|
|
||||||
|
@ -2169,6 +2169,9 @@ sub object_list_changed {
|
|||||||
$self->{htoolbar}->EnableTool($_, $have_objects)
|
$self->{htoolbar}->EnableTool($_, $have_objects)
|
||||||
for (TB_RESET, TB_ARRANGE);
|
for (TB_RESET, TB_ARRANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# prepagate the event to the frame (a custom Wx event would be cleaner)
|
||||||
|
$self->GetFrame->on_plater_object_list_changed($have_objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub selection_changed {
|
sub selection_changed {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user