It is currently March 28th, 2024, 6:06 pm

Change Fontcolor(s) in "InlineSettings" (String Meter)

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Change Fontcolor(s) in "InlineSettings" (String Meter)

Post by Youkai1977 »

It's like that again, I can't get any further.

I want to change the font color in a meter when the value changes in a measure.
In this case, if the network fails, the "Offline" writing will be red. If it were just declared using "FontColor" it would be easy.
But I work with the "InlineSetting" function.
What do I have to change in the corresponding measure so that it changes from white to red with the corresponding color effect?

Here is my skin code. What can be found in the corresponding measure does not work. And nothing else that I have found here in the forum or on the Internet either

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=Info-Meter
Author=Youkai1977 
Version=2021 <> 26.01.
Information=This Meter is a Part of M.A.R.S.- 2021 Skin Package
License=Creative Commons BY-NC-SA 3.0

;--------------------------------------------------
;--- VARIABLES & STYLES ---------------------------
;--------------------------------------------------

[Variables]
Images=#@#images\
ImgAlpha=100
ColorEffect1=0,78,195,230
ColorEffect2=17,207,255,230
ColorEffect3=164,164,164,230
ColorEffect4=200,200,200,230
WarnColor1=255,0,0,230
WarnColor2=135,0,0,230
WarnShadow=165,0,0,170
ShadowEffect1=0,78,195,170
ShadowEffect2=164,164,164,170
FrameColor1=0,78,195,230
FrameColor2=68,118,255,230
BGColor1=0,78,195,60
BGColor2=68,118,255,130
FS=10

[Style1]
FontFace=UBUNTU LIGHT
AntiAlias=1

[Style2]
FontWeight=600

[Style3]
StringAlign=LEFT

[Style4]
StringAlign=CENTER

[Style5]
InlineSetting=GradientColor | 90 | #ColorEffect1# ; 1.0 | #ColorEffect2# ; 0.5
InlineSetting2=Shadow | 0 | 0 | 2.5 | #ShadowEffect1#

[Style6]
InlineSetting=GradientColor | 270 | #ColorEffect3# ; 0.5 | #ColorEffect4# ; 1.0
InlineSetting2=Shadow | 0 | 0 | 2.5 | #ShadowEffect2#

[Style7]
InlineSetting=GradientColor | 270 | #WarnColor1# ; 0.5 | #WarnColor2# ; 1.0
InlineSetting2=Shadow | 0 | 0 | 2.5 | #WarnShadow#

;--------------------------------------------------
;--- MEASURES -------------------------------------
;--------------------------------------------------

[mUser]
Measure=PLUGIN
Plugin=SysInfo
SysInfoType=USER_NAME

[mCurTime]
Measure=Time

[mAccTime]
Measure=Plugin
Plugin=SysInfo
SysInfoType=USER_LOGONTIME
UpdateDivider=-1

[mLogInDuration]
Measure=Uptime
Group=Account
SecondsValue=([mCurTime:]-[mAccTime:])
Format=%4!02i!:%3!02i!:%2!02i!:%1!02i!
DynamicVariables=1

[mAccountLogInTime]
Measure=Time
Group=Account
TimeStamp=[mAccTime]
Format=%a %d.%m.%Y %H:%M:%S
TimeStampLocale=de-DE
FormatLocale=Local
Format=%#c
Substitute="Mo":"MO","Di":"DI","Mi":"MI","Do":"DO","Fr":"FR","Sa":"SA","So":"SO"
DynamicVariables=1

[mTerminal]
Measure=PLUGIN
Plugin=SysInfo
SysInfoType=COMPUTER_NAME
UpdateDivider=-1

[mConnectivityLAN]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
IfConditionMode=1
IfCondition=mConnectivityLAN = -1
IfTrueAction=[!SetOption LANStatus Text "OFFLINE"][!SetVariable [Style7] [Style6]]
IfCondition2=mConnectivityLAN = 1
IfTrueAction2=[!SetOption LANStatus Text "ONLINE"][!SetVariable [Style6] [Style7]]
OnUpdateAction=[!UpdateMeter LANStatus][!Redraw]
UpdateDivider=5

[mOSName]
Measure=PLUGIN
Plugin=SysInfo
SysInfoType=OS_VERSION
UpdateDivider=-1

[mOSBits]
Measure=PLUGIN
Plugin=SysInfo
SysInfoType=OS_BITS
UpdateDivider=-1

[mOSVersion]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=CurrentBuild
UpdateDivider=-1

;--------------------------------------------------
;--- CURRENT USER & SYSTEM-INFO (SYS-Control) -----
;--------------------------------------------------

[BG_Frame]
Meter=Shape
X=0
Y=0
Shape=Rectangle 0,0,312,60,4 | StrokeWidth 2 | Stroke LinearGradient StrokeGradient | Fill RadialGradient FillGradient | Offset 1,1
Shape2=Line 0,0,300,2 | StrokeWidth 2 | Stroke RadialGradient LineGradient | Offset 7,39
Shape3=Rectangle 0,70,242,78,4 | StrokeWidth 2 | Stroke LinearGradient StrokeGradient | Fill RadialGradient FillGradient | Offset 1,1
FillGradient=0,0,0,0,170,50 | #BGColor2# ; 0.0 | #BGColor1# ; 1.0
LineGradient=0,0 | #FrameColor1# ; 0.0 | #FrameColor2# ; 1.0
StrokeGradient=90 | #FrameColor1# ; 0.0 | #FrameColor2# ; 1.0
UpdateDivider=-1

[BG_Logo]
Meter=IMAGE
ImageName=#Images#logo1.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=r
Y=69r
W=244
H=80
UpdateDivider=-1

[UserTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=OPERATOR:
X=6
Y=5
UpdateDivider=-1

[User]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style6
FontSize=#FS#
Text=[mUser]
ClipString=1
X=83r
Y=r
W=220
UpdateDivider=-1

[LogInTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=LOG IN:
X=6
Y=16r
UpdateDivider=-1

[LogInTime]
Meter=STRING
MeterStyle=Style1 | Style3 | Style6
FontSize=#FS#
Text=[mAccountLogInTime] ([mLogInDuration])
X=83r
Y=r
DynamicVariables=1

[TerminalTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=TERMINAL:
ClipString=1
X=6
Y=21r
W=220
UpdateDivider=-1

[TERMINAL]
Meter=STRING
MeterStyle=Style1 | Style3 | Style6
FontSize=#FS#
Text=[mTerminal]
X=83r
Y=r
DynamicVariables=1

[LANStatusTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=NETWORK:
X=90r
Y=r
DynamicVariables=1

[LANStatus]
Meter=STRING
MeterStyle=Style1 | Style4 | Style6
FontSize=#FS#
Text=[mConnectivityLAN]
X=103r
Y=r
DynamicVariables=1

[BaseOSTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=BASE-OS:
X=6
Y=30r
UpdateDivider=-1

[BaseOS]
Meter=STRING
MeterStyle=Style1 | Style3 | Style6
FontSize=#FS#
Text=[mOSName] x[mOSBits] ([mOSVersion])
X=83r
Y=r
DynamicVariables=1
UpdateDivider=-1

As you can see in the code, my last attempt was that the measure should swap the [Style6] for [Style7] in the "LANStatus" meter. But of course that doesn't (probably) work.
Where is my mistake here?

So, which Rainmeter expert pulls my ears long after laughing to death :Whistle and explains to me or changes my tinkering into something that works?
Attachments
Example.png
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Change Fontcolor(s) in "InlineSettings" (String Meter)

Post by SilverAzide »

You can't swap styles like that. [!SetVariable [Style7] [Style6]] isn't valid because styles are not variables. You'll need to use a !SetOption bang and set the InlineSetting option on the LANStatus meter displaying the text directly.

This isn't your question, but it would be a whole lot simpler if you didn't do any swapping or !SetOption stuff. Just configure two meters sitting directly on top of each other, one for "online" and the other for "offline", then set the Hidden option on both to a formula that will react to the [mConnectivityLAN] measure to show or hide as needed, no IfActions or other stuff needed (you'll need to keep using DynamicVariables=1 on the meters, however).
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: Change Fontcolor(s) in "InlineSettings" (String Meter)

Post by Youkai1977 »

What a shame, I thought you could exchange these color values ​​in the inline setting, or the [Style] set (by me).
Yes, I am familiar with the variant you have described, and I have also used it elsewhere. However, I am currently trying (taking into account that I have to translate everything I can find help or skins / tricks into my language German, since my English is for tons) to optimize my skins on the code side and to optimize the functions of the newer Rainmeter versions adapt.
As you can see, through translation errors or whatever, I don't understand a lot or do it wrongly.
Well, then just in the old fashioned way ... 2 meters to "Hidden", and the measure switches me to the necessary active.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Change Fontcolor(s) in "InlineSettings" (String Meter)

Post by SilverAzide »

Youkai1977 wrote: January 26th, 2021, 10:01 pm What a shame, I thought you could exchange these color values ​​in the inline setting, or the [Style] set (by me).
I'm sorry, I didn't mean to say that you could not change the color values in the inline setting, I just meant that you can't do it in the way you did with a !SetVariable bang. You can do it with a !SetOption bang. As in: !SetOption LANStatus InlineSetting "....". This will work for sure.
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: Change Fontcolor(s) in "InlineSettings" (String Meter)

Post by Youkai1977 »

No problem. I am happy about any help. :bow: :thumbup:
And that's exactly what I thought it could work that way.
But there you can see it, I must have phrased it unhappily. :oops:
Well, I'll test it now and report back later :-)

[EDIT by Youkai1977]:
Yeah ...
That was what I was looking for.
Thanks again.
When I put the code snippet into my skin, it felt like scales in front of my eyes. I had already tried that, but it didn't work.
Then I saw what I had forgotten. I missed the "" in my attempt.
Because that's something I don't really understand. For many things, if you set [! Set ... * blah *] or [! Show ...] [! Hide ...] you don't need a "".
But then apparently with some bangs ... somebody should understand that ... in German ^.^;

Well, whatever. Now it works.
So as always ... THANK YOU :great: :bow:

Here is the corrected skin:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=Info-Meter
Author=Youkai1977 
Version=2021 <> 26.01.
Information=This Meter is a Part of M.A.R.S.- 2021 Skin Package
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

;--------------------------------------------------
;--- VARIABLES & STYLES ---------------------------
;--------------------------------------------------

[Variables]
Images=#@#images\
ImgAlpha=100
ColorEffect1=0,78,195,230
ColorEffect2=17,207,255,230
ColorEffect3=164,164,164,230
ColorEffect4=200,200,200,230
WarnColor1=135,0,0,230
WarnColor2=255,0,0,230
WarnShadow=165,0,0,170
ShadowEffect1=0,78,195,170
ShadowEffect2=164,164,164,170
FrameColor1=0,78,195,230
FrameColor2=68,118,255,230
BGColor1=0,78,195,60
BGColor2=68,118,255,130
FS=10

[Style1]
FontFace=UBUNTU LIGHT
AntiAlias=1

[Style2]
FontWeight=600

[Style3]
StringAlign=LEFT

[Style4]
StringAlign=CENTER

[Style5]
InlineSetting=GradientColor | 90 | #ColorEffect1# ; 1.0 | #ColorEffect2# ; 0.5
InlineSetting2=Shadow | 0 | 0 | 2.5 | #ShadowEffect1#

[Style6]
InlineSetting=GradientColor | 270 | #ColorEffect3# ; 0.5 | #ColorEffect4# ; 1.0
InlineSetting2=Shadow | 0 | 0 | 2.5 | #ShadowEffect2#

;--------------------------------------------------
;--- MEASURES -------------------------------------
;--------------------------------------------------

[mUser]
Measure=PLUGIN
Plugin=SysInfo
SysInfoType=USER_NAME

[mCurTime]
Measure=Time

[mAccTime]
Measure=Plugin
Plugin=SysInfo
SysInfoType=USER_LOGONTIME
UpdateDivider=-1

[mLogInDuration]
Measure=Uptime
Group=Account
SecondsValue=([mCurTime:]-[mAccTime:])
Format=%4!02i!:%3!02i!:%2!02i!:%1!02i!
DynamicVariables=1

[mAccountLogInTime]
Measure=Time
Group=Account
TimeStamp=[mAccTime]
Format=%a %d.%m.%Y %H:%M:%S
TimeStampLocale=de-DE
FormatLocale=Local
Format=%#c
Substitute="Mo":"MO","Di":"DI","Mi":"MI","Do":"DO","Fr":"FR","Sa":"SA","So":"SO"
DynamicVariables=1

[mTerminal]
Measure=PLUGIN
Plugin=SysInfo
SysInfoType=COMPUTER_NAME
UpdateDivider=-1

[mConnectivityLAN]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
IfConditionMode=1
IfCondition=mConnectivityLAN = -1
IfTrueAction=[!SetOption LANStatus Text "OFFLINE"][!SetOption LANStatus InlineSetting "GradientColor | 90 | #WarnColor1# ; 0.5 | #WarnColor2# ; 1.0"][!SetOption LANStatus InlineSetting2 "Shadow | 0 | 0 | 2.5 | #WarnShadow#"]
IfCondition2=mConnectivityLAN = 1
IfTrueAction2=[!SetOption LANStatus Text "ONLINE"][!SetOption LANStatus InlineSetting "GradientColor | 270 | #ColorEffect3# ; 0.5 | #ColorEffect4# ; 1.0"][!SetOption LANStatus InlineSetting2 "Shadow | 0 | 0 | 2.5 | #ShadowEffect2#"]
OnUpdateAction=[!UpdateMeter LANStatus][!Redraw]
UpdateDivider=5

[mOSName]
Measure=PLUGIN
Plugin=SysInfo
SysInfoType=OS_VERSION
UpdateDivider=-1

[mOSBits]
Measure=PLUGIN
Plugin=SysInfo
SysInfoType=OS_BITS
UpdateDivider=-1

[mOSVersion]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=CurrentBuild
UpdateDivider=-1

;--------------------------------------------------
;--- CURRENT USER & SYSTEM-INFO (SYS-Control) -----
;--------------------------------------------------

[BG_Frame]
Meter=Shape
X=0
Y=0
Shape=Rectangle 0,0,312,60,4 | StrokeWidth 2 | Stroke LinearGradient StrokeGradient | Fill RadialGradient FillGradient | Offset 1,1
Shape2=Line 0,0,300,2 | StrokeWidth 2 | Stroke RadialGradient LineGradient | Offset 7,39
Shape3=Rectangle 0,70,242,78,4 | StrokeWidth 2 | Stroke LinearGradient StrokeGradient | Fill RadialGradient FillGradient | Offset 1,1
FillGradient=0,0,0,0,170,50 | #BGColor2# ; 0.0 | #BGColor1# ; 1.0
LineGradient=0,0 | #FrameColor1# ; 0.0 | #FrameColor2# ; 1.0
StrokeGradient=90 | #FrameColor1# ; 0.0 | #FrameColor2# ; 1.0
UpdateDivider=-1

[BG_Logo]
Meter=IMAGE
ImageName=#Images#logo1.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=r
Y=69r
W=244
H=80
UpdateDivider=-1

[UserTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=OPERATOR:
X=6
Y=5
UpdateDivider=-1

[User]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style6
FontSize=#FS#
Text=[mUser]
ClipString=1
X=83r
Y=r
W=220
UpdateDivider=-1

[LogInTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=LOG IN:
X=6
Y=16r
UpdateDivider=-1

[LogInTime]
Meter=STRING
MeterStyle=Style1 | Style3 | Style6
FontSize=#FS#
Text=[mAccountLogInTime] ([mLogInDuration])
X=83r
Y=r
DynamicVariables=1

[TerminalTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=TERMINAL:
ClipString=1
X=6
Y=21r
W=220
UpdateDivider=-1

[TERMINAL]
Meter=STRING
MeterStyle=Style1 | Style3 | Style6
FontSize=#FS#
Text=[mTerminal]
X=83r
Y=r
DynamicVariables=1

[LANStatusTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=NETWORK:
X=90r
Y=r
DynamicVariables=1

[LANStatus]
Meter=STRING
MeterStyle=Style1 | Style4
FontSize=#FS#
Text=[mConnectivityLAN]
X=103r
Y=r
DynamicVariables=1

[BaseOSTitel]
Meter=STRING
MeterStyle=Style1 | Style2 | Style3 | Style5
FontSize=#FS#
Text=BASE-OS:
X=6
Y=30r
UpdateDivider=-1

[BaseOS]
Meter=STRING
MeterStyle=Style1 | Style3 | Style6
FontSize=#FS#
Text=[mOSName] x[mOSBits] ([mOSVersion])
X=83r
Y=r
DynamicVariables=1
UpdateDivider=-1


Post Reply