Select last appended part in object parts panel

This commit is contained in:
Alessandro Ranellucci 2014-07-12 11:46:03 +02:00
parent f428888dd9
commit b8a629f0b6

View File

@ -106,11 +106,12 @@ sub reload_tree {
$tree->DeleteChildren($rootId);
my $itemId;
foreach my $volume_id (0..$#{$object->volumes}) {
my $volume = $object->volumes->[$volume_id];
my $icon = $volume->modifier ? ICON_MODIFIERMESH : ICON_SOLIDMESH;
my $itemId = $tree->AppendItem($rootId, $volume->name || $volume_id, $icon);
$itemId = $tree->AppendItem($rootId, $volume->name || $volume_id, $icon);
$tree->SetPlData($itemId, {
type => 'volume',
volume_id => $volume_id,
@ -118,7 +119,11 @@ sub reload_tree {
}
$tree->ExpandAll;
$self->selection_changed;
# select last appended part
# This will trigger the selection_changed() event
Slic3r::GUI->CallAfter(sub {
$self->{tree}->SelectItem($itemId);
});
}
sub get_selection {