If tabs are used, make them fixed instead of appearing/disappearing.

Fixes #4462
This commit is contained in:
Joseph Lenox 2018-11-10 09:59:48 -06:00
parent 703adba7e3
commit 59164f7bbb
2 changed files with 10 additions and 3 deletions

View File

@ -99,7 +99,7 @@ sub _init_tabpanel {
my $panel = $self->{tabpanel}->GetPage($self->{tabpanel}->GetSelection); my $panel = $self->{tabpanel}->GetPage($self->{tabpanel}->GetSelection);
$panel->OnActivate if $panel->can('OnActivate'); $panel->OnActivate if $panel->can('OnActivate');
if ($self->{tabpanel}->GetSelection > 1) { if ($self->{tabpanel}->GetSelection > 1) {
$self->{tabpanel}->SetWindowStyle($self->{tabpanel}->GetWindowStyleFlag | wxAUI_NB_CLOSE_ON_ACTIVE_TAB); $self->{tabpanel}->SetWindowStyle($self->{tabpanel}->GetWindowStyleFlag);
} elsif(!$Slic3r::GUI::Settings->{_}{show_host} && ($self->{tabpanel}->GetSelection == 1)){ } elsif(!$Slic3r::GUI::Settings->{_}{show_host} && ($self->{tabpanel}->GetSelection == 1)){
$self->{tabpanel}->SetWindowStyle($self->{tabpanel}->GetWindowStyleFlag | wxAUI_NB_CLOSE_ON_ACTIVE_TAB); $self->{tabpanel}->SetWindowStyle($self->{tabpanel}->GetWindowStyleFlag | wxAUI_NB_CLOSE_ON_ACTIVE_TAB);
} else { } else {
@ -119,6 +119,13 @@ sub _init_tabpanel {
$panel->AddPage($self->{plater} = Slic3r::GUI::Plater->new($panel), "Plater"); $panel->AddPage($self->{plater} = Slic3r::GUI::Plater->new($panel), "Plater");
$panel->AddPage($self->{controller} = Slic3r::GUI::Controller->new($panel), "Controller") $panel->AddPage($self->{controller} = Slic3r::GUI::Controller->new($panel), "Controller")
if ($Slic3r::GUI::Settings->{_}{show_host}); if ($Slic3r::GUI::Settings->{_}{show_host});
if ($Slic3r::GUI::Settings->{_}{tabbed_preset_editors}) {
$self->{plater}->show_preset_editor('print', 0,0,0);
$self->{plater}->show_preset_editor('filament', 0,0,0);
$self->{plater}->show_preset_editor('printer', 0, 0, 0);
}
} }
sub _init_menubar { sub _init_menubar {

View File

@ -892,7 +892,7 @@ sub selected_presets {
} }
sub show_preset_editor { sub show_preset_editor {
my ($self, $group, $i) = @_; my ($self, $group, $i, $load) = @_;
wxTheApp->CallAfter(sub { wxTheApp->CallAfter(sub {
my @presets = $self->selected_presets($group); my @presets = $self->selected_presets($group);
@ -908,7 +908,7 @@ sub show_preset_editor {
} elsif ($Slic3r::GUI::Settings->{_}{tabbed_preset_editors}) { } elsif ($Slic3r::GUI::Settings->{_}{tabbed_preset_editors}) {
my $class = "Slic3r::GUI::PresetEditor::" . ucfirst($group); my $class = "Slic3r::GUI::PresetEditor::" . ucfirst($group);
$mainframe->{preset_editor_tabs}{$group} = $preset_editor = $class->new($self->GetFrame); $mainframe->{preset_editor_tabs}{$group} = $preset_editor = $class->new($self->GetFrame);
$tabpanel->AddPage($preset_editor, ucfirst($group) . " Settings", 1); $tabpanel->AddPage($preset_editor, ucfirst($group) . " Settings", $load);
} else { } else {
my $class = "Slic3r::GUI::PresetEditorDialog::" . ucfirst($group); my $class = "Slic3r::GUI::PresetEditorDialog::" . ucfirst($group);
$dlg = $class->new($self); $dlg = $class->new($self);