From 1a3569b9a81d6b9ca88941793926327051506122 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 31 Aug 2012 16:30:03 +0200 Subject: [PATCH] img -> css scaling, muss aber noch gefixt werden --- bin/mozilla/menu.pl | 25 ++++++++++++------------- templates/webpages/menu/menu.html | 7 +++---- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/bin/mozilla/menu.pl b/bin/mozilla/menu.pl index 75f2bc44e..16d8b75ae 100644 --- a/bin/mozilla/menu.pl +++ b/bin/mozilla/menu.pl @@ -40,12 +40,10 @@ use strict; use SL::Menu; -use Data::Dumper; use URI; use List::MoreUtils qw(apply); -my $menufile = "menu.ini"; my $nbsp = ' '; my $mainlevel; @@ -140,7 +138,7 @@ sub section_menu { } elsif ($menuitem->{submenu}) { my $image = make_image(submenu => 1); if ($mainlevel && $item =~ /^\Q$mainlevel\E/) { - push @items, make_item(target => $menuitem->{target}, spacer => $spacer, bold => 1, img => $image, label => $label, class => 'submenu') if $show; + push @items, make_item(target => $menuitem->{target}, spacer => $spacer, img => $image, label => $label, class => 'submenu') if $show; push @items, section_menu($menu, $item); } else { push @items, make_item(spacer => $spacer, href => $anchor, img => $image, label => $label . ' ...', class => 'submenu') if $show; @@ -190,22 +188,23 @@ sub multiline { sub make_image { my (%params) = @_; - my $label = $params{label}; my $icon = $params{icon}; my $size = $params{size} || 16; return unless _show_images(); my $icon_found = $icon && -f _icon_path($icon, $size); - - my $image_url = $icon_found ? _icon_path($icon, $size) : "image/unterpunkt.png"; - my $width = $icon_found ? $size : 24; - - my $padding = $size == 16 && $icon_found ? $nbsp x 2 - : $size == 24 ? $nbsp - : ''; - - return "$label$padding"; + my $padding = $size == 16 && $icon_found ? $nbsp x 2 + : $size == 24 ? $nbsp + : ''; + + return { + src => $icon_found ? _icon_path($icon, $size) : "image/unterpunkt.png", + alt => $params{label}, + width => $icon_found ? $size : 24, + height => $size, + padding => $padding, + } } sub _calc_framesize { diff --git a/templates/webpages/menu/menu.html b/templates/webpages/menu/menu.html index 5e1c1c7db..25081d4f2 100644 --- a/templates/webpages/menu/menu.html +++ b/templates/webpages/menu/menu.html @@ -2,10 +2,9 @@ @@ -18,9 +17,9 @@ [%- FOREACH chunk IN item.chunks %] [%- END %] -- 2.20.1