- Enter degrees in Celsius and it displays the value in Fahrenheit
- Enter the weight in Metric and it returns the Imperial value
- Enter Tbsp. and it'll tell me how many tsp. that is.
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
Solidcolor=0,0,0,150
SkinWidth=160
SkinHeight=100
[Variables]
TempScale=0
Temp=0
CheckStrokeColor=51,51,51
ButtonColor=80,80,80,150
ButtonStrokeColor=160,160,160
FontName=Segoe UI
[RadioButtonStyle]
Shape=Rectangle 0,0,14,14,7 | Extend RadioButtonModifiers
RadioButtonModifiers=Fill Color 255,255,255 | StrokeWidth 1 | Stroke Color #CheckStrokeColor#
DynamicVariables=1
[RadioButtonCheckStyle]
X=3r
Y=3r
Shape=Rectangle 0,0,8,8,4 | Extend RadioButtonModifiers
RadioButtonModifiers=Fill Color 51,51,51 | StrokeWidth 1 | Stroke Color 51,51,51
DynamicVariables=1
Hidden=1
[StringStyle]
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontFace=#FontName#
StringStyle=BOLD
AntiAlias=1
DynamicVariables=1
[MeasureScale]
Measure=Calc
Formula=#TempScale#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!ShowMeter "MeterRadioButtonCelsiusCheck"][!HideMeter "MeterRadioButtonFahrenheitCheck"][!SetOption MeterTemperature Text "#*Temp*#[\x00B0]C = %1[\x00B0]F"][!UpdateMeter "MeterTemperature"][!Redraw]
IfFalseAction=[!HideMeter "MeterRadioButtonCelsiusCheck"][!ShowMeter "MeterRadioButtonFahrenheitCheck"][!SetOption MeterTemperature Text "#*Temp*#[\x00B0]F = %1[\x00B0]C"][!UpdateMeter "MeterTemperature"][!Redraw]
DynamicVariables=1
[MeasureTemperature]
Measure=Calc
Formula=(( #TempScale# = 0 ) ? ( 1.8 * #Temp# + 32 ) : (( #Temp# - 32 ) / 1.8 ))
DynamicVariables=1
[MeterRadioButtonCelsius]
Meter=Shape
MeterStyle=RadioButtonStyle
X=5
Y=5
MouseOverAction=[!SetVariable CheckStrokeColor "0,120,215"][!SetOption #CURRENTSECTION#String InlineSetting "Underline"][!UpdateMeter "#CURRENTSECTION#"][!UpdateMeter "#CURRENTSECTION#String"][!Redraw]
MouseLeaveAction=[!SetVariable CheckStrokeColor "51,51,51"][!SetOption #CURRENTSECTION#String InlineSetting "None"][!UpdateMeter "#CURRENTSECTION#"][!UpdateMeter "#CURRENTSECTION#String"][!Redraw]
LeftMouseUpAction=[!SetVariable TempScale "0"][!SetVariable Temp "0"][!UpdateMeasure "MeasureScale"][!UpdateMeasure "MeasureTemperature"][!UpdateMeter "MeterTemperature"][!Redraw]
[MeterRadioButtonCelsiusCheck]
Meter=Shape
MeterStyle=RadioButtonCheckStyle
[MeterRadioButtonCelsiusString]
Meter=STRING
MeterStyle=StringStyle
X=16r
Y=-5r
W=90
H=18
ClipString=1
FontSize=10
StringAlign=LEFT
Text=[\x00B0]C -> [\x00B0]F
MouseOverAction=[!SetVariable CheckStrokeColor "0,120,215"][!SetOption #CURRENTSECTION# InlineSetting "Underline"][!UpdateMeter "MeterRadioButtonElapsedTime1"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetVariable CheckStrokeColor "51,51,51"][!SetOption #CURRENTSECTION# InlineSetting "None"][!UpdateMeter "MeterRadioButtonElapsedTime1"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseUpAction=[!SetVariable TempScale "0"][!SetVariable Temp "0"][!UpdateMeasure "MeasureScale"][!UpdateMeasure "MeasureTemperature"][!UpdateMeter "MeterTemperature"][!Redraw]
[MeterRadioButtonFahrenheit]
Meter=Shape
MeterStyle=RadioButtonStyle
X=-19r
Y=8R
MouseOverAction=[!SetVariable CheckStrokeColor "0,120,215"][!SetOption #CURRENTSECTION#String InlineSetting "Underline"][!UpdateMeter "#CURRENTSECTION#"][!UpdateMeter "#CURRENTSECTION#String"][!Redraw]
MouseLeaveAction=[!SetVariable CheckStrokeColor "51,51,51"][!SetOption #CURRENTSECTION#String InlineSetting "None"][!UpdateMeter "#CURRENTSECTION#"][!UpdateMeter "#CURRENTSECTION#String"][!Redraw]
LeftMouseUpAction=[!SetVariable TempScale "1"][!SetVariable Temp "32"][!UpdateMeasure "MeasureScale"][!UpdateMeasure "MeasureTemperature"][!UpdateMeter "MeterTemperature"][!Redraw]
[MeterRadioButtonFahrenheitCheck]
Meter=Shape
MeterStyle=RadioButtonCheckStyle
[MeterRadioButtonFahrenheitString]
Meter=STRING
MeterStyle=StringStyle
X=16r
Y=-5r
W=90
H=18
ClipString=1
FontSize=10
StringAlign=LEFT
Text=[\x00B0]F -> [\x00B0]C
MouseOverAction=[!SetVariable CheckStrokeColor "0,120,215"][!SetOption #CURRENTSECTION# InlineSetting "Underline"][!UpdateMeter "MeterRadioButtonElapsedTime1"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetVariable CheckStrokeColor "51,51,51"][!SetOption #CURRENTSECTION# InlineSetting "None"][!UpdateMeter "MeterRadioButtonElapsedTime1"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseUpAction=[!SetVariable TempScale "1"][!SetVariable Temp "32"][!UpdateMeasure "MeasureScale"][!UpdateMeasure "MeasureTemperature"][!UpdateMeter "MeterTemperature"][!Redraw]
[MeasureInputTemperature]
Measure=Plugin
Plugin=InputText
SolidColor=229,241,251
StringAlign=LEFT
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=0,0,0
FontFace=#FontName#
FontSize=10
X=10
Y=50
W=70
H=16
FocusDismiss=1
DefaultValue=#Temp#
InputNumber=1
Command1=[!SetVariable Temp "$UserInput$"]
UpdateDivider=86400
DynamicVariables=1
[MeterTemperature]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTemperature
X=80
Y=64
Padding=15,5,15,5
FontSize=12
StringAlign=CENTER
LeftMouseUpAction=[!CommandMeasure MeasureInputTemperature "ExecuteBatch 1"]
Yes, this way the list can go infinite, but initially CoffeeJoe has asked just for:Yamajac wrote: ↑November 12th, 2019, 3:57 am You'd need one measure for each conversion you want, so it's not really hard on a per-conversion basis but it starts to get kinda crazy once you think about things like a teaspoon to a cup is one measure. A tablespoon to a cup is another measure. A teaspoon to a tablespoon is another one. Cup to teaspoon another, cup to tablespoon, tablespoon to teaspoon, foot to meter, foot to kilometer, foot to yard, mile to kilometer, kilometer to mile, celcius to fahrenheit, fahrenheit to celcius, pound to kilogram. Kilogram to gram. Gram to pound. Pound to stone. The list goes on. Where do you stop?
And such a small list can be handled easily even through a Rainmeter code.
Well I sincerely doubt OP is only after Celsius -> Fahrenheit, Kilograms -> Pounds and Tablespoons -> Teaspoons. My understanding is they want an all purpose unit conversion skin.
His request specifically was just about these three. Obviously as more conversions are needed, as more complicated the skin becomes.
Googling was a good idea.jsmorley wrote: ↑November 10th, 2019, 1:23 pm I don't think I have seen a Rainmeter skin that does this, mostly because there are so many thousands of things you can convert between, you would need just boatloads of keywords and formulas. The effort seems to fit a bad cost/benefit curve in my view, since it is just so easy to say "5 tablespoons to teaspoons", or any other unit conversion question, in your browser URL, and Google will pretty much instantly tell you the answer.
1.jpg
I mean, each individual one would be trivial to do, but the aggregate would be the Bataan Death March.
https://www.convertworld.com/en/