From 3ced3ee91fb174bb037d3a45251aa90552595784 Mon Sep 17 00:00:00 2001 From: Richard Goodwin Date: Tue, 6 Dec 2011 15:36:42 -0600 Subject: [PATCH] Fixed bolding and font issues on Windows --- lib/Slic3r/GUI/OptionsGroup.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/GUI/OptionsGroup.pm b/lib/Slic3r/GUI/OptionsGroup.pm index dbbcddef0..1fec31136 100644 --- a/lib/Slic3r/GUI/OptionsGroup.pm +++ b/lib/Slic3r/GUI/OptionsGroup.pm @@ -2,10 +2,11 @@ package Slic3r::GUI::OptionsGroup; use strict; use warnings; -use Wx qw(:sizer); +use Wx qw(:sizer wxSYS_DEFAULT_GUI_FONT); use Wx::Event qw(EVT_TEXT EVT_CHECKBOX EVT_CHOICE); use base 'Wx::StaticBoxSizer'; + # not very elegant, but this solution is temporary waiting for a better GUI our @reload_callbacks = (); @@ -17,13 +18,19 @@ sub new { my $self = $class->SUPER::new($box, wxVERTICAL); my $grid_sizer = Wx::FlexGridSizer->new(scalar(@{$p{options}}), 2, 2, 0); - my $bold_font = Wx::SystemSettings::GetFont(0); + + #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, [180,-1]); $label->Wrap(180); # needed to avoid Linux/GTK bug + + #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)$/) {