I want to show a badge displaying the number of incoming not read mails (just like push notification in iphone).
First issue (can't solve by myself)
I want to display the badge if there is 1 new incoming mail or more and i want to hide the badge if there are no mails.
Second issue (can't solve by myself)
If the number of incoming mails is greater than 9, the badge should stretch and reposition itself
with the number centered within it.
Third issue (can't solve by myself)
Same thing if the number of incoming mails is greater than 99.
Here the code:
Code: Select all
[Rainmeter]
Update=1000
[Variables]
Url=https://username:password@gmail.google.com/gmail/feed/atom
RegExp="(?siU)<fullcount>(.*)</fullcount>"
Codepage=0
DownloadLogo=1
FontName=Arial
IconSize=130
BadgeSize=( 4000 / #IconSize# )
FontSize=( ( #BadgeSize# * 37 ) / 100 )
White=255, 255, 255, 255
============
; Measures
;===========
[MeasureRSSNews]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#Url#
RegExp=#RegExp#
Codepage=#Codepage#
Download=#DownloadLogo#
UpdateRate=1
StringIndex=4
FinishAction=!Execute [!RainmeterRedraw]
[MeasureTitle]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureRSSNews]
StringIndex=1
UpdateRate=1
DynamicVariables=1
IfEqualValue=0
IfEqualAction=!execute [!RainmeterHideMeter [MeterTitle]][!RainmeterHideMeter [MeterBadge]]
IfAboveValue=0
IfBelowAction=!execute [!RainmeterShowMeter [MeterTitle]][!RainmeterShowMeter [MeterBadge]]
;=========
; Meters
;=========
[MeterIcon]
Meter=IMAGE
X=0
Y=0
W=#IconSize#
PreserveAspectRatio=1
ImageName=Icons\Mailbox.png
LeftMouseUpAction=!Execute ["http://mail.google.com/mail/"]
[MeterBadge]
Meter=IMAGE
X=5
Y=20
W=#BadgeSize#
PreserveAspectRatio=1
ImageName=Icons\Badge1.png
LeftMouseUpAction=!Execute ["http://mail.google.com/mail/"]
[MeterTitle]
Meter=STRING
MeasureName=MeasureTitle
X=14
Y=25
FontColor=#White#
StringStyle=BOLD
FontSize=#FontSize#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["http://mail.google.com/mail/"]