aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaarten Vanraes <alien@mageia.org>2016-04-24 21:26:18 +0200
committerMaarten Vanraes <alien@mageia.org>2016-04-24 23:22:50 +0200
commitcd375baf24bade48b3444a1e29df886f7f777ca4 (patch)
tree415c5dfd6377409bfd9fe7ef2946c34a5a84c88e /lib
parent47411dd1c6a5a031386d6b271d22f6ed1c7354be (diff)
downloadmanatools-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')
-rw-r--r--lib/ManaTools/Shared/GUI/Properties.pm15
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