diff --git a/fhem/contrib/InfoPanel/55_InfoPanel.pm b/fhem/contrib/InfoPanel/55_InfoPanel.pm index a1f79bff2..9110aa0c8 100644 --- a/fhem/contrib/InfoPanel/55_InfoPanel.pm +++ b/fhem/contrib/InfoPanel/55_InfoPanel.pm @@ -56,6 +56,7 @@ sub btIP_itemSeconds; sub btIP_itemText; sub btIP_itemTextBox; sub btIP_itemTime; +sub btIP_itemImg; sub btIP_color; sub btIP_xy; @@ -475,6 +476,43 @@ sub btIP_itemTime { return btIP_itemText($id,$x,$y,sprintf("%02d:%02d", $hour, $min),%params); } +sub btIP_itemTrash { + my ($id,$x,$y,$scale,$fgcolor,$bgcolor,%params)= @_; + $id = ($id eq '-') ? createUniqueId() : $id; + + my ($counter,$data,$info,$width,$height,$mimetype,$output); + +$data = ''. +''. +''. +''. +' '. +' '. +' '. +' '. +''. +''; + + my ($r,$g,$b,$a) = btIP_color($fgcolor); + $fgcolor = "rgb($r,$g,$b)"; + $data =~ s/fgcolor/$fgcolor/g; + + ($r,$g,$b,$a) = btIP_color($bgcolor); + $bgcolor = "rgb($r,$g,$b)"; + ($width,$height,$mimetype,$data) = _btIP_imgData($data,$scale); + $output = "\n"; + $output .= "\n"; + $output .= "\n"; + return $output; +} + ##### Helper sub btIP_color { @@ -883,6 +921,16 @@ sub btIP_evalLayout($$@) { $svg .= btIP_itemTime($id,$x,$y,%params); } + when("trash") { + ($id,$x,$y,$scale,$r1,$r2)= split("[ \t]+", $def,6); + ($x,$y)= btIP_xy($x,$y,%params); + $params{xx} = $x; + $params{yy} = $y; + $r1 = AnalyzePerlCommand(undef,$r1); + $r2 = AnalyzePerlCommand(undef,$r2); + $svg .= btIP_itemTrash($id,$x,$y,$scale,$r1,$r2,%params); + } + default { if($cmd ~~ @cmd_halign) { my $d = AnalyzePerlCommand(undef, $def);