From f74beec8aed8472937e6d9caa4dd315a2bdaa1fc Mon Sep 17 00:00:00 2001
From: betateilchen <>
Date: Sun, 1 Feb 2015 20:52:23 +0000
Subject: [PATCH] contrib/InfoPanel - added item: trash
git-svn-id: https://svn.fhem.de/fhem/trunk@7827 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/contrib/InfoPanel/55_InfoPanel.pm | 48 ++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
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);