From b1805ed7f3eaa12e221640a030a4623db72e7265 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Thu, 2 Aug 2012 23:44:42 +0200 Subject: [PATCH] Align controls and their associated labels vertically centered. --- lib/Slic3r/GUI/OptionsGroup.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Slic3r/GUI/OptionsGroup.pm b/lib/Slic3r/GUI/OptionsGroup.pm index 162fc8793..087bfbc7c 100644 --- a/lib/Slic3r/GUI/OptionsGroup.pm +++ b/lib/Slic3r/GUI/OptionsGroup.pm @@ -76,7 +76,7 @@ sub BUILD { if (!$self->no_labels) { $label = Wx::StaticText->new($self->parent, -1, "$opt->{label}:", wxDefaultPosition, [$self->label_width, -1]); $label->Wrap($self->label_width) ; # needed to avoid Linux/GTK bug - $grid_sizer->Add($label); + $grid_sizer->Add($label, 0, wxALIGN_CENTER_VERTICAL, 0); } my $field; @@ -109,7 +109,7 @@ sub BUILD { Wx::StaticText->new($self->parent, -1, " y:"), my $y_field = Wx::TextCtrl->new($self->parent, -1, $opt->{default}->[1], wxDefaultPosition, $field_size), ); - $field->Add($_) for @items; + $field->Add($_, 0, wxALIGN_CENTER_VERTICAL, 0) for @items; if ($opt->{tooltip}) { $_->SetToolTipString($opt->{tooltip}) for @items; } @@ -135,13 +135,13 @@ sub BUILD { $field->SetToolTipString($opt->{tooltip}) if $opt->{tooltip} && $field->can('SetToolTipString'); if ($opt->{sidetext}) { my $sizer = Wx::BoxSizer->new(wxHORIZONTAL); - $sizer->Add($field); + $sizer->Add($field, 0, wxALIGN_CENTER_VERTICAL, 0); my $sidetext = Wx::StaticText->new($self->parent, -1, $opt->{sidetext}, wxDefaultPosition, wxDefaultSize); $sidetext->SetFont($sidetext_font); $sizer->Add($sidetext, 0, wxLEFT | wxALIGN_CENTER_VERTICAL , 4); $grid_sizer->Add($sizer); } else { - $grid_sizer->Add($field, 0, $opt->{full_width} ? wxEXPAND : 0); + $grid_sizer->Add($field, 0, ($opt->{full_width} ? wxEXPAND : 0) | wxALIGN_CENTER_VERTICAL, 0); } }