Align controls and their associated labels vertically centered.
This commit is contained in:
parent
5518ac9fa6
commit
b1805ed7f3
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue