Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 482

Need better way to automatically change background Height

$
0
0
I have a meter that displays the computer hostname. I'm trying to have the meter background height dynamically resized based on the font size and have relatively equal spacing from top to bottom regardless of size. I've hacked a way to do this, but the results are not consistent.
Any help is appreciated.

FontSize=10
10.jpg
FontSize=24
24.jpg

Code:

[MeterBackground]Meter=ShapeShape=Rectangle (0 * #Scale#),(0 * #Scale#),((#BgWidth# - 0) * #Scale#),((#BgHeight# - 0) * #Scale#),(0 * #Scale#) | Fill Color #BackgroundColor#,(#BgAlpha#) | StrokeWidth 0UpdateDivider=-1

Code:

[Variables]BgHeight=((7 + (#TitleFontSize# - 1)) + (#TitleFontSize# / 4))BgWidth=326BackgroundColor=0,0,0BgAlpha=75TitleFontSize=24
BgHeight=((7 + (#TitleFontSize# - 1)) + (#TitleFontSize# / 4))

Code:

[MeasureComputerName]Measure=SysInfoSysInfoType=COMPUTER_NAMEUpdateDivider=-1

Code:

[MeterComputerName]Meter=StringFontFace=ArialFontSize=#TitleFontSize#StringAlign=CenterFontWeight=700StringCase=UpperFontColor=255,165,79AntiAlias=1Text=%1X=(#BgWidth# / 2)Y=((#BgHeight# / 2) - (#TitleFontSize# + 0))TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#UpdateDivider=-1
Y=((#BgHeight# / 2) - (#TitleFontSize# + 0))

Statistics: Posted by Sh8dyDan — Today, 8:45 pm — Replies 7 — Views 61



Viewing all articles
Browse latest Browse all 482

Trending Articles