aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ManaTools
diff options
context:
space:
mode:
authorMaarten Vanraes <alien@mageia.org>2016-05-09 00:21:17 +0200
committerMaarten Vanraes <alien@mageia.org>2016-05-09 00:21:17 +0200
commit0db6f42eadd442e494f95fed75b4ff6b190674b7 (patch)
tree9f59d212d8ca264ed80abee074337d304cec6e93 /lib/ManaTools
parent14f4701faac6ed5d25076428989c2f0f335b9816 (diff)
downloadmanatools-0db6f42eadd442e494f95fed75b4ff6b190674b7.tar
manatools-0db6f42eadd442e494f95fed75b4ff6b190674b7.tar.gz
manatools-0db6f42eadd442e494f95fed75b4ff6b190674b7.tar.bz2
manatools-0db6f42eadd442e494f95fed75b4ff6b190674b7.tar.xz
manatools-0db6f42eadd442e494f95fed75b4ff6b190674b7.zip
Module: default icon is dependant on name
Diffstat (limited to 'lib/ManaTools')
-rw-r--r--lib/ManaTools/Module.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ManaTools/Module.pm b/lib/ManaTools/Module.pm
index ee2a8bb9..d4f2eb0f 100644
--- a/lib/ManaTools/Module.pm
+++ b/lib/ManaTools/Module.pm
@@ -51,8 +51,16 @@ use yui;
has 'icon' => (
is => 'rw',
isa => 'Str',
+ lazy => 1,
+ builder => '_iconInitializer',
);
+sub _iconInitializer {
+ my $self = shift;
+
+ return File::ShareDir::dist_file(ManaTools::Shared::distName(), sprintf('images/%s.png', $self->name())),
+}
+
#=============================================================
=head2 name