1. Scaling InputText plugin input boxes
2. Scaling a dynamically sized border image
I made an example skin that shows off both of these issues at once: (Please note that this skin implements my dynamic positioning system, so there is a bit of extra fluff that doesn't directly pertain to my issue.)
As you can see, when the skin is scaled to anything except for 1.00, despite the dimensions of the inputtext input box being correct, the text remains at the x1 scale factor. I tried multiplying the FontSize value by the scale factor, but that didn't have very good results. I am at a loss as to how to solve this.
The border image is simply a transparent square with a 1-pixel-wide white outline. I use the ScaleMargins option to be able to resize this border image to whatever dimensions I require, and use it for outlining input boxes, line graphs, and the gadget background, as you can see here: This works great at a x1 scale factor. However, the moment you change the scale factor, the image becomes blurry and inconsistent. A possible solution would be to not use an image with ScaleMargins, but instead use four separate image meters that simply use SolidColor, but I would like to be able to do it with one meter if possible.
I have attached a .RMSKIN for this demo. I have also included the skin code below, and attached the relevant image separately, just in case.
Code: Select all
[Rainmeter]
MiddleMouseUpAction=[!Refresh]
DynamicWindowSize=1
AccurateText=1
[Variables]
; Positioning
bgOffset=5
bgWidth=45
contentMarginAbs=3
contentMargin=(#contentMarginAbs# + #bgOffset# - 1)
contentMarginRight=(#bgWidth# - #contentMarginAbs# + #bgOffset# - 1)
contentWidth=(#contentMarginRight# - #contentMargin#)
; Scaling
scale=1.00
transformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#
; Colors
colorInputBoxText=170,170,170
colorInputBoxBg=30,30,30
colorInputBoxBorder=50,50,50
; Font
fontFace=Helvetica
[StyleInputBoxBackground]
ImageName=#@#border.png
ImageTint=#colorInputBoxBorder#
SolidColor=#colorInputBoxBg#
X=#contentMargin#
Y=#contentMargin#
W=#contentWidth#
H=19
ScaleMargins=2,2,2,2
TransformationMatrix=#transformationMatrix#
[StyleInputBoxText]
FontSize=10
FontFace=#fontFace#
FontColor=#colorInputBoxText#
X=3r
Y=1r
W=([&[#CURRENTSECTION]Background:W] - 6)
H=16
Padding=0,-1,0,0
ClipString=1
DynamicVariables=1
AntiAlias=1
TransformationMatrix=#transformationMatrix#
[StyleMouseRegion]
SolidColor=255,0,0,0
DynamicVariables=1
X=([#CURRENTSECTION#_:X] * #scale# + #scale#)
Y=([#CURRENTSECTION#_:Y] * #scale# + #scale#)
W=([#CURRENTSECTION#_:W] * #scale#)
H=([#CURRENTSECTION#_:H] * #scale#)
; ----- Measures -----
[MeasureInputText]
Measure=Plugin
Plugin=InputText
; Use a different color, for debugging
SolidColor=45,45,45
FontColor=#colorInputBoxText#
FontSize=10
FontFace=#fontFace#
UpdateDivider=-1
FocusDismiss=1
InputLimit=30
Antialias=1
DynamicVariables=1
Command1=[!WriteKeyValue Variables scale "$UserInput$"][!Refresh] DefaultValue="#scale#" X=[MeterScaleInputBox:X] Y=[MeterScaleInputBox:Y] W=[MeterScaleInputBox:W] H=[MeterScaleInputBox:H]
; ----- Meters -----
[MeterBackgroundMargin]
Meter=Image
SolidColor=255,255,255,50
X=-1
Y=-1
W=((#bgWidth# + (#bgOffset# * 2)) * #scale#)
H=([MeterBackgroundHeight:Y] * #scale#)
DynamicVariables=1
Group=BgMeters
TransformationMatrix=#transformationMatrix#
[MeterBackground]
Meter=Image
SolidColor=15,15,15
X=(#bgOffset# - 1)
Y=(#bgOffset# - 1)
W=#bgWidth#
H=([MeterBackgroundHeight:Y] - (#bgOffset# * 2))
ScaleMargins=2,2,2,2
DynamicVariables=1
Group=BgMeters
TransformationMatrix=#transformationMatrix#
[MeterScaleInputBox_Background]
Meter=Image
MeterStyle=StyleInputBoxBackground
[MeterScaleInputBox_]
Meter=String
MeterStyle=StyleInputBoxText
Text=#scale#
[MeterBgAdjustor]
Meter=Image
X=r
Y=4R
TransformationMatrix=#transformationMatrix#
[MeterBackgroundHeight]
Meter=Image
SolidColor=255,255,255,255
X=0
Y=(#contentMarginAbs# + #bgOffset#)R
W=((#bgWidth# + (#bgOffset# * 2)) * #scale#)
H=1
DynamicVariables=1
Group=BgMeters
TransformationMatrix=#transformationMatrix#
; ----- Mouse Regions -----
[MeterScaleInputBox]
Meter=Image
MeterStyle=StyleMouseRegion
LeftMouseUpAction=[!CommandMeasure MeasureInputText "Executebatch 1"]