mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
contrib/InfoPanel: added text decoration
git-svn-id: https://svn.fhem.de/fhem/trunk@7821 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ee55d622c1
commit
7be315107e
@ -423,8 +423,12 @@ sub btIP_itemText {
|
||||
|
||||
my $output = "<text id=\”$id\” x=\"$x\" y=\"$y\" ".
|
||||
"fill=\"rgb($r,$g,$b)\" fill-opacity=\"$a\" ".
|
||||
"font-size=\"$params{pt}px\" font-family=\"$params{font}\" ".
|
||||
"font-family=\"$params{font}\" ".
|
||||
"font-style=\"$params{fontstyle}\" ".
|
||||
"font-size=\"$params{pt}px\" ".
|
||||
"font-weight=\"$params{fontweight}\" ".
|
||||
"text-anchor=\"$params{thalign}\" ".
|
||||
"text-decoration=\"$params{textdecoration}\" ".
|
||||
"alignment-baseline=\"$params{tvalign}\" ".
|
||||
">\n$text\n</text>\n";
|
||||
|
||||
@ -638,6 +642,9 @@ sub btIP_evalLayout($$@) {
|
||||
$params{padding} = 0;
|
||||
$params{xx}= 0;
|
||||
$params{yy}= 0;
|
||||
$params{fontstyle} = "initial";
|
||||
$params{fontweight} = "normal";
|
||||
$params{textdecoration} = "none";
|
||||
|
||||
$defs{$name}{fhem}{div} = undef;
|
||||
|
||||
@ -850,6 +857,24 @@ sub btIP_evalLayout($$@) {
|
||||
$params{tbalign} = $def;
|
||||
}
|
||||
|
||||
when("textdesign") {
|
||||
my @args = split(/,/,$def);
|
||||
my @deco = qw(underline overline line-through); #text-decoration
|
||||
my @style = qw(italic oblique); #font-style
|
||||
my @weight = qw(bold); #font-weight
|
||||
$params{fontstyle} = "initial";
|
||||
$params{fontweight} = "initial";
|
||||
$params{textdecoration} = "none";
|
||||
|
||||
foreach my $s (@args) {
|
||||
if($s ne 'clear') {
|
||||
$params{fontstyle} = "$s " if($s ~~ @style);
|
||||
$params{fontweight} = "$s " if($s ~~ @weight);
|
||||
$params{textdecoration} = "$s " if($s ~~ @deco);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
when("time") {
|
||||
($id,$x,$y)= split("[ \t]+", $def, 3);
|
||||
($x,$y)= btIP_xy($x,$y,%params);
|
||||
|
Loading…
x
Reference in New Issue
Block a user