mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 02:37:51 -06:00
Remove label for large text fields
This commit is contained in:
parent
ce9fdbc047
commit
b7983b54f8
3 changed files with 35 additions and 16 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue