diff options
author | Maarten Vanraes <alien@mageia.org> | 2016-04-24 21:26:18 +0200 |
---|---|---|
committer | Maarten Vanraes <alien@mageia.org> | 2016-04-24 23:22:50 +0200 |
commit | cd375baf24bade48b3444a1e29df886f7f777ca4 (patch) | |
tree | 415c5dfd6377409bfd9fe7ef2946c34a5a84c88e /lib/ManaTools/Shared/GUI/Properties.pm | |
parent | 47411dd1c6a5a031386d6b271d22f6ed1c7354be (diff) | |
download | manatools-cd375baf24bade48b3444a1e29df886f7f777ca4.tar manatools-cd375baf24bade48b3444a1e29df886f7f777ca4.tar.gz manatools-cd375baf24bade48b3444a1e29df886f7f777ca4.tar.bz2 manatools-cd375baf24bade48b3444a1e29df886f7f777ca4.tar.xz manatools-cd375baf24bade48b3444a1e29df886f7f777ca4.zip |
Properties GUI helper is better aligned
Diffstat (limited to 'lib/ManaTools/Shared/GUI/Properties.pm')
-rw-r--r-- | lib/ManaTools/Shared/GUI/Properties.pm | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/ManaTools/Shared/GUI/Properties.pm b/lib/ManaTools/Shared/GUI/Properties.pm index ab86f4a7..79278b5a 100644 --- a/lib/ManaTools/Shared/GUI/Properties.pm +++ b/lib/ManaTools/Shared/GUI/Properties.pm @@ -108,6 +108,12 @@ has 'properties' => ( default => undef, ); +has 'labelWeight' => ( + is => 'rw', + isa => 'Int', + default => 25, +); + has 'replacepoint' => ( is => 'ro', isa => 'ManaTools::Shared::GUI::ReplacePoint', @@ -152,13 +158,16 @@ sub refresh { for my $key (sort $properties->properties()) { # $properties->prop($key) my $hbox = $factory->createHBox($vbox); - $factory->createLabel($hbox, $key .': '); + my $align = $factory->createRight($hbox); + my $label = $factory->createLabel($align, $key .': '); + $align->setWeight(0, $self->labelWeight()); my $val = $properties->prop($key); $val = '' if (!defined($val)); $val = '' if (ref($val) ne ''); $val = ''. $val; - $factory->createOutputField($hbox, $val); - $factory->createHStretch($hbox); + my $field = $factory->createOutputField($hbox, $val); + $field->setWeight(0, 100 - $self->labelWeight()); + $factory->createHSpacing($hbox, 3); } } # finished |