mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Make window resizable
This commit is contained in:
parent
19a78de82f
commit
f38f2f139e
6 changed files with 26 additions and 23 deletions
|
@ -16,7 +16,7 @@ our $Options = {
|
||||||
cli => 'notes=s',
|
cli => 'notes=s',
|
||||||
type => 's',
|
type => 's',
|
||||||
multiline => 1,
|
multiline => 1,
|
||||||
width => 450,
|
full_width => 1,
|
||||||
height => 130,
|
height => 130,
|
||||||
serialize => sub { join '\n', split /\R/, $_[0] },
|
serialize => sub { join '\n', split /\R/, $_[0] },
|
||||||
deserialize => sub { join "\n", split /\\n/, $_[0] },
|
deserialize => sub { join "\n", split /\\n/, $_[0] },
|
||||||
|
@ -33,7 +33,7 @@ our $Options = {
|
||||||
label => 'Output filename format',
|
label => 'Output filename format',
|
||||||
cli => 'output-filename-format=s',
|
cli => 'output-filename-format=s',
|
||||||
type => 's',
|
type => 's',
|
||||||
width => 300,
|
full_width => 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
# printer options
|
# printer options
|
||||||
|
@ -319,7 +319,7 @@ our $Options = {
|
||||||
cli => 'start-gcode=s',
|
cli => 'start-gcode=s',
|
||||||
type => 's',
|
type => 's',
|
||||||
multiline => 1,
|
multiline => 1,
|
||||||
width => 350,
|
full_width => 1,
|
||||||
height => 120,
|
height => 120,
|
||||||
serialize => sub { join '\n', split /\R+/, $_[0] },
|
serialize => sub { join '\n', split /\R+/, $_[0] },
|
||||||
deserialize => sub { join "\n", split /\\n/, $_[0] },
|
deserialize => sub { join "\n", split /\\n/, $_[0] },
|
||||||
|
@ -329,7 +329,7 @@ our $Options = {
|
||||||
cli => 'end-gcode=s',
|
cli => 'end-gcode=s',
|
||||||
type => 's',
|
type => 's',
|
||||||
multiline => 1,
|
multiline => 1,
|
||||||
width => 350,
|
full_width => 1,
|
||||||
height => 120,
|
height => 120,
|
||||||
serialize => sub { join '\n', split /\R+/, $_[0] },
|
serialize => sub { join '\n', split /\R+/, $_[0] },
|
||||||
deserialize => sub { join "\n", split /\\n/, $_[0] },
|
deserialize => sub { join "\n", split /\\n/, $_[0] },
|
||||||
|
@ -339,7 +339,7 @@ our $Options = {
|
||||||
cli => 'layer-gcode=s',
|
cli => 'layer-gcode=s',
|
||||||
type => 's',
|
type => 's',
|
||||||
multiline => 1,
|
multiline => 1,
|
||||||
width => 350,
|
full_width => 1,
|
||||||
height => 50,
|
height => 50,
|
||||||
serialize => sub { join '\n', split /\R+/, $_[0] },
|
serialize => sub { join '\n', split /\R+/, $_[0] },
|
||||||
deserialize => sub { join "\n", split /\\n/, $_[0] },
|
deserialize => sub { join "\n", split /\\n/, $_[0] },
|
||||||
|
@ -349,7 +349,7 @@ our $Options = {
|
||||||
cli => 'post-process=s@',
|
cli => 'post-process=s@',
|
||||||
type => 's@',
|
type => 's@',
|
||||||
multiline => 1,
|
multiline => 1,
|
||||||
width => 350,
|
full_width => 1,
|
||||||
height => 60,
|
height => 60,
|
||||||
serialize => sub { join '; ', @{$_[0]} },
|
serialize => sub { join '; ', @{$_[0]} },
|
||||||
deserialize => sub { [ split /\s*;\s*/, $_[0] ] },
|
deserialize => sub { [ split /\s*;\s*/, $_[0] ] },
|
||||||
|
@ -416,12 +416,14 @@ our $Options = {
|
||||||
sidetext => 'approximate seconds',
|
sidetext => 'approximate seconds',
|
||||||
cli => 'fan-below-layer-time=i',
|
cli => 'fan-below-layer-time=i',
|
||||||
type => 'i',
|
type => 'i',
|
||||||
|
width => 60,
|
||||||
},
|
},
|
||||||
'slowdown_below_layer_time' => {
|
'slowdown_below_layer_time' => {
|
||||||
label => 'Slow down if layer print time is below',
|
label => 'Slow down if layer print time is below',
|
||||||
sidetext => 'approximate seconds',
|
sidetext => 'approximate seconds',
|
||||||
cli => 'slowdown-below-layer-time=i',
|
cli => 'slowdown-below-layer-time=i',
|
||||||
type => 'i',
|
type => 'i',
|
||||||
|
width => 60,
|
||||||
},
|
},
|
||||||
'min_print_speed' => {
|
'min_print_speed' => {
|
||||||
label => 'Min print speed',
|
label => 'Min print speed',
|
||||||
|
|
|
@ -21,14 +21,11 @@ sub OnInit {
|
||||||
$self->SetAppName('Slic3r');
|
$self->SetAppName('Slic3r');
|
||||||
Slic3r::debugf "wxWidgets version %s\n", &Wx::wxVERSION_STRING;
|
Slic3r::debugf "wxWidgets version %s\n", &Wx::wxVERSION_STRING;
|
||||||
|
|
||||||
my $frame = Wx::Frame->new( undef, -1, 'Slic3r', [-1, -1], Wx::wxDefaultSize,
|
my $frame = Wx::Frame->new(undef, -1, 'Slic3r', [-1, -1], [760,500], wxDEFAULT_FRAME_STYLE);
|
||||||
wxDEFAULT_FRAME_STYLE ^ (wxRESIZE_BORDER | wxMAXIMIZE_BOX) );
|
|
||||||
Wx::Image::AddHandler(Wx::PNGHandler->new);
|
Wx::Image::AddHandler(Wx::PNGHandler->new);
|
||||||
$frame->SetIcon(Wx::Icon->new("$Slic3r::var/Slic3r_128px.png", &Wx::wxBITMAP_TYPE_PNG) );
|
$frame->SetIcon(Wx::Icon->new("$Slic3r::var/Slic3r_128px.png", &Wx::wxBITMAP_TYPE_PNG) );
|
||||||
|
|
||||||
my $panel = Slic3r::GUI::SkeinPanel->new($frame);
|
my $panel = Slic3r::GUI::SkeinPanel->new($frame);
|
||||||
my $box = Wx::BoxSizer->new(wxVERTICAL);
|
|
||||||
$box->Add($panel, 0);
|
|
||||||
|
|
||||||
if (eval "use Growl::GNTP; 1") {
|
if (eval "use Growl::GNTP; 1") {
|
||||||
# register growl notifications
|
# register growl notifications
|
||||||
|
@ -75,8 +72,7 @@ sub OnInit {
|
||||||
# will not be handled correctly
|
# will not be handled correctly
|
||||||
$frame->SetMenuBar($menubar);
|
$frame->SetMenuBar($menubar);
|
||||||
|
|
||||||
$box->SetSizeHints($frame);
|
$frame->SetMinSize($frame->GetSize);
|
||||||
$frame->SetSizer($box);
|
|
||||||
$frame->Show;
|
$frame->Show;
|
||||||
$frame->Layout;
|
$frame->Layout;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,9 @@ sub new {
|
||||||
my $self = $class->SUPER::new($box, wxVERTICAL);
|
my $self = $class->SUPER::new($box, wxVERTICAL);
|
||||||
|
|
||||||
my $grid_sizer = Wx::FlexGridSizer->new(scalar(@{$p{options}}), 2, ($p{no_labels} ? 1 : 2), 0);
|
my $grid_sizer = Wx::FlexGridSizer->new(scalar(@{$p{options}}), 2, ($p{no_labels} ? 1 : 2), 0);
|
||||||
|
$grid_sizer->SetFlexibleDirection(&Wx::wxHORIZONTAL);
|
||||||
|
$grid_sizer->AddGrowableCol($p{no_labels} ? 0 : 1);
|
||||||
|
|
||||||
# grab the default font, to fix Windows font issues/keep things consistent
|
# grab the default font, to fix Windows font issues/keep things consistent
|
||||||
my $bold_font = Wx::SystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
my $bold_font = Wx::SystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||||
$bold_font->SetWeight(&Wx::wxFONTWEIGHT_BOLD);
|
$bold_font->SetWeight(&Wx::wxFONTWEIGHT_BOLD);
|
||||||
|
@ -101,7 +103,7 @@ sub new {
|
||||||
$sizer->Add($sidetext, 0, &Wx::wxLEFT, 4);
|
$sizer->Add($sidetext, 0, &Wx::wxLEFT, 4);
|
||||||
$grid_sizer->Add($sizer);
|
$grid_sizer->Add($sizer);
|
||||||
} else {
|
} else {
|
||||||
$grid_sizer->Add($field);
|
$grid_sizer->Add($field, 0, $opt->{full_width} ? &Wx::wxEXPAND : 0);
|
||||||
}
|
}
|
||||||
$fields{$opt_key} ||= [$field];
|
$fields{$opt_key} ||= [$field];
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ sub new {
|
||||||
$self->{list} = Wx::ListView->new($self, -1, [-1, -1], [-1, 180], &Wx::wxLC_SINGLE_SEL | &Wx::wxLC_REPORT | &Wx::wxBORDER_DEFAULT);
|
$self->{list} = Wx::ListView->new($self, -1, [-1, -1], [-1, 180], &Wx::wxLC_SINGLE_SEL | &Wx::wxLC_REPORT | &Wx::wxBORDER_DEFAULT);
|
||||||
$self->{list}->InsertColumn(0, "Name", &Wx::wxLIST_FORMAT_LEFT, 300);
|
$self->{list}->InsertColumn(0, "Name", &Wx::wxLIST_FORMAT_LEFT, 300);
|
||||||
$self->{list}->InsertColumn(1, "Copies", &Wx::wxLIST_FORMAT_CENTER, 50);
|
$self->{list}->InsertColumn(1, "Copies", &Wx::wxLIST_FORMAT_CENTER, 50);
|
||||||
$self->{list}->InsertColumn(2, "Scale", &Wx::wxLIST_FORMAT_CENTER, 50);
|
$self->{list}->InsertColumn(2, "Scale", &Wx::wxLIST_FORMAT_CENTER, &Wx::wxLIST_AUTOSIZE_USEHEADER);
|
||||||
EVT_LIST_ITEM_SELECTED($self, $self->{list}, \&list_item_selected);
|
EVT_LIST_ITEM_SELECTED($self, $self->{list}, \&list_item_selected);
|
||||||
EVT_LIST_ITEM_DESELECTED($self, $self->{list}, \&list_item_deselected);
|
EVT_LIST_ITEM_DESELECTED($self, $self->{list}, \&list_item_deselected);
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ sub new {
|
||||||
|
|
||||||
my $sizer = Wx::BoxSizer->new(wxVERTICAL);
|
my $sizer = Wx::BoxSizer->new(wxVERTICAL);
|
||||||
$sizer->Add($buttons_sizer, 0, wxEXPAND | wxALL, 10);
|
$sizer->Add($buttons_sizer, 0, wxEXPAND | wxALL, 10);
|
||||||
$sizer->Add($tabpanel);
|
$sizer->Add($tabpanel, 1, wxEXPAND);
|
||||||
|
|
||||||
$sizer->SetSizeHints($self);
|
$sizer->SetSizeHints($self);
|
||||||
$self->SetSizer($sizer);
|
$self->SetSizer($sizer);
|
||||||
|
|
|
@ -101,6 +101,7 @@ sub new {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title => 'Cooling thresholds',
|
title => 'Cooling thresholds',
|
||||||
|
label_width => 250,
|
||||||
options => [qw(fan_below_layer_time slowdown_below_layer_time min_print_speed)],
|
options => [qw(fan_below_layer_time slowdown_below_layer_time min_print_speed)],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
@ -132,11 +133,7 @@ sub new {
|
||||||
{
|
{
|
||||||
title => 'Post-processing scripts',
|
title => 'Post-processing scripts',
|
||||||
no_labels => 1,
|
no_labels => 1,
|
||||||
options => [qw(post_process)], # this is not the right place for duplicate_distance
|
options => [qw(post_process)],
|
||||||
},
|
|
||||||
{
|
|
||||||
title => 'Other',
|
|
||||||
options => [qw(duplicate_distance)], # this is not the right place for duplicate_distance
|
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -149,6 +146,10 @@ sub new {
|
||||||
title => 'Flow',
|
title => 'Flow',
|
||||||
options => [qw(bridge_flow_ratio)],
|
options => [qw(bridge_flow_ratio)],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title => 'Other',
|
||||||
|
options => [qw(duplicate_distance)],
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -227,13 +228,15 @@ package Slic3r::GUI::Tab::Page;
|
||||||
|
|
||||||
use Wx qw(:sizer :progressdialog);
|
use Wx qw(:sizer :progressdialog);
|
||||||
use Wx::Event qw();
|
use Wx::Event qw();
|
||||||
use base 'Wx::Panel';
|
use base 'Wx::ScrolledWindow';
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my ($parent, %params) = @_;
|
my ($parent, %params) = @_;
|
||||||
my $self = $class->SUPER::new($parent, -1);
|
my $self = $class->SUPER::new($parent, -1);
|
||||||
|
|
||||||
|
$self->SetScrollbars(1, 1, 1, 1);
|
||||||
|
|
||||||
$self->{vsizer} = Wx::BoxSizer->new(&Wx::wxVERTICAL);
|
$self->{vsizer} = Wx::BoxSizer->new(&Wx::wxVERTICAL);
|
||||||
$self->SetSizer($self->{vsizer});
|
$self->SetSizer($self->{vsizer});
|
||||||
|
|
||||||
|
@ -247,7 +250,7 @@ sub new {
|
||||||
sub append_optgroup {
|
sub append_optgroup {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $optgroup = Slic3r::GUI::OptionsGroup->new($self, @_, label_width => 200);
|
my $optgroup = Slic3r::GUI::OptionsGroup->new($self, label_width => 200, @_);
|
||||||
$self->{vsizer}->Add($optgroup, 0, wxEXPAND | wxALL, 5);
|
$self->{vsizer}->Add($optgroup, 0, wxEXPAND | wxALL, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue