Remove label for large text fields
This commit is contained in:
parent
ce9fdbc047
commit
b7983b54f8
@ -16,7 +16,7 @@ our $Options = {
|
||||
cli => 'notes=s',
|
||||
type => 's',
|
||||
multiline => 1,
|
||||
width => 220,
|
||||
width => 450,
|
||||
height => 130,
|
||||
serialize => sub { join '\n', split /\R/, $_[0] },
|
||||
deserialize => sub { join "\n", split /\\n/, $_[0] },
|
||||
|
@ -18,22 +18,25 @@ sub new {
|
||||
my $box = Wx::StaticBox->new($parent, -1, $p{title});
|
||||
my $self = $class->SUPER::new($box, wxVERTICAL);
|
||||
|
||||
my $grid_sizer = Wx::FlexGridSizer->new(scalar(@{$p{options}}), 2, 2, 0);
|
||||
my $grid_sizer = Wx::FlexGridSizer->new(scalar(@{$p{options}}), 2, ($p{no_labels} ? 1 : 2), 0);
|
||||
|
||||
#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);
|
||||
$bold_font->SetWeight(&Wx::wxFONTWEIGHT_BOLD);
|
||||
|
||||
|
||||
foreach my $opt_key (@{$p{options}}) {
|
||||
my $opt = $Slic3r::Config::Options->{$opt_key};
|
||||
my $label = Wx::StaticText->new($parent, -1, "$opt->{label}:", Wx::wxDefaultPosition,
|
||||
[$p{label_width} || 180, -1]);
|
||||
$label->Wrap($p{label_width} || 180); # needed to avoid Linux/GTK bug
|
||||
my $label;
|
||||
if (!$p{no_labels}) {
|
||||
$label = Wx::StaticText->new($parent, -1, "$opt->{label}:", Wx::wxDefaultPosition, [$p{label_width} || 180, -1]);
|
||||
$label->Wrap($p{label_width} || 180) ; # needed to avoid Linux/GTK bug
|
||||
$grid_sizer->Add($label);
|
||||
|
||||
# set the bold font point size to the same size as all the other labels (for consistency)
|
||||
$bold_font->SetPointSize($label->GetFont()->GetPointSize());
|
||||
$label->SetFont($bold_font) if $opt->{important};
|
||||
}
|
||||
|
||||
#set the bold font point size to the same size as all the other labels (for consistency)
|
||||
$bold_font->SetPointSize($label->GetFont()->GetPointSize());
|
||||
$label->SetFont($bold_font) if $opt->{important};
|
||||
my $field;
|
||||
if ($opt->{type} =~ /^(i|f|s|s@)$/) {
|
||||
my $style = 0;
|
||||
@ -92,7 +95,7 @@ sub new {
|
||||
} else {
|
||||
die "Unsupported option type: " . $opt->{type};
|
||||
}
|
||||
$grid_sizer->Add($_) for $label, $field;
|
||||
$grid_sizer->Add($field);
|
||||
$fields{$opt_key} ||= [$field];
|
||||
}
|
||||
|
||||
|
@ -115,6 +115,7 @@ sub new {
|
||||
$self->AddOptionsPage('Notes', 'note.png', optgroups => [
|
||||
{
|
||||
title => 'Notes',
|
||||
no_labels => 1,
|
||||
options => [qw(notes)],
|
||||
},
|
||||
]);
|
||||
@ -129,8 +130,13 @@ sub new {
|
||||
options => [qw(gcode_comments output_filename_format)],
|
||||
},
|
||||
{
|
||||
title => 'Advanced',
|
||||
options => [qw(post_process duplicate_distance)], # this is not the right place for duplicate_distance
|
||||
title => 'Post-processing scripts',
|
||||
no_labels => 1,
|
||||
options => [qw(post_process)], # this is not the right place for duplicate_distance
|
||||
},
|
||||
{
|
||||
title => 'Other',
|
||||
options => [qw(duplicate_distance)], # this is not the right place for duplicate_distance
|
||||
},
|
||||
]);
|
||||
|
||||
@ -187,8 +193,19 @@ sub new {
|
||||
|
||||
$self->AddOptionsPage('Custom G-code', 'cog.png', optgroups => [
|
||||
{
|
||||
title => 'Custom G-code',
|
||||
options => [qw(start_gcode end_gcode layer_gcode)],
|
||||
title => 'Start G-code',
|
||||
no_labels => 1,
|
||||
options => [qw(start_gcode)],
|
||||
},
|
||||
{
|
||||
title => 'End G-code',
|
||||
no_labels => 1,
|
||||
options => [qw(end_gcode)],
|
||||
},
|
||||
{
|
||||
title => 'Layer change G-code',
|
||||
no_labels => 1,
|
||||
options => [qw(layer_gcode)],
|
||||
},
|
||||
]);
|
||||
|
||||
@ -203,7 +220,6 @@ sub new {
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user