It is currently March 28th, 2024, 4:41 pm

Inputtext solid color and font color opacity problem

Get help with installing and using Rainmeter.
Post Reply
CaGhOsT
Posts: 2
Joined: August 7th, 2017, 9:01 am

Inputtext solid color and font color opacity problem

Post by CaGhOsT »

Hello,
I've got a problem with the (inputtext plugin) SolidColor elements opacity setting opacity for FontColor element aswell. I've read already that they are indeed connected. I'm here asking if there is a way to seperate those and make the search box almost invisible while the text inside it is visible.
code if that helps:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Metadata]
Name=
Author=
Information=
Version=1.0
[MeterShape]
Meter=Shape
Shape=Rectangle 20,20,640,50,10| Fill Color 225,225,225,25 | StrokeWidth 4 | Stroke Color 255,255,255
LeftMouseUpAction=!RainmeterPluginBang "MeasureInput ExecuteBatch 1"
[MeterImage]
Meter=Image
ImageName=@Resources\Google_logo.png
x=-5
y=-5
W=180
H=100
[MeasureInput]
Measure=Plugin
Plugin=InputText.dll
X=130
Y=28
W=520
H=34
SolidColor=255,255,255
FontColor=0,0,0
FontFace=ROBOTO
FontSize=18
FocusDismiss=1
Command1=!Execute ["http://www.google.com/search?q=$UserInput$"] DefaultValue=""
btw most of this stuff i just copied off of the rainmeter manual thing and some other search box inis
Last edited by CaGhOsT on August 7th, 2017, 9:11 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Inputtext solid color and font color opacity problem

Post by jsmorley »

No, not really. You can have the initial "box", before you click in it, be a Shape or Image meter with as much transparency as you want, but once you click in it the input field created by the InputText measure will share transparency settings with both the input field, and the text in it. In reality, the "alpha" value on FontColor is entirely ignored by an InputText measure. Only the alpha value on SolidColor is used.

Nothing we can easily do about that, Windows itself does not support native input controls with transparent fields and solid text. Creating our own custom input control with all the capabilities of the native control would just be a Manhattan Project level of effort.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeterBack]
Meter=Shape
Shape=Rectangle 0.75, 0.75, 202, 24 | StrokeWidth 1.5 | Stroke Color 47,47,47,150 | Fill Color 211,211,211,90
LeftMouseUpAction=[!CommandMeasure MeasureInput "ExecuteBatch 1"]

[MeasureInput]
Measure=Plugin
Plugin=InputText
X=3
Y=2
W=198
H=22
SolidColor=211,211,211,255
FontColor=47,47,47,255
FontSize=11
AntiAlias=1
FocusDismiss=1
Command1=[!Log "$UserInput$"]
GIF.gif
P.S. These:

LeftMouseUpAction=!RainmeterPluginBang "MeasureInput ExecuteBatch 1"
Command1=!Execute ["http://www.google.com/search?q=$UserInput$"] DefaultValue=""

Are a very old and deprecated syntax. Please don't use them. The correct syntax is:

LeftMouseUpAction=[!CommandMeasure MeasureInput "ExecuteBatch 1"]
Command1=["http://www.google.com/search?q=$UserInput$"] DefaultValue=""

https://docs.rainmeter.net/manual/bangs/#Deprecated

https://docs.rainmeter.net/manual/bangs/#CommandMeasure
https://docs.rainmeter.net/manual/skins/option-types/#Action
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Inputtext solid color and font color opacity problem

Post by jsmorley »

Just to be anal-retentive about this, I don't find that fact that you have to have the input text sorta "jammed up" against the left of the input box in the code above to be entirely pleasing. I'd be tempted to do:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeterBack]
Meter=Shape
Shape=Rectangle 0.75, 0.75, 202, 24 | StrokeWidth 1.5 | Stroke Color 47,47,47,150 | Extend Fill
Fill=Fill Color 211,211,211,90
LeftMouseUpAction=[!SetOption MeterBack Fill "Fill Color 211,211,211,255"][!UpdateMeter MeterBack][!Redraw][!CommandMeasure MeasureInput "ExecuteBatch 1"]

[MeasureInput]
Measure=Plugin
Plugin=InputText
X=6
Y=2
W=192
H=22
SolidColor=211,211,211,255
FontColor=47,47,47,50
FontSize=12
AntiAlias=1
FocusDismiss=1
OnDismissAction=[!SetOption MeterBack Fill "Fill Color 211,211,211,90"][!UpdateMeter MeterBack][!Redraw]
Command1=[!Log "$UserInput$"][!SetOption MeterBack Fill "Fill Color 211,211,211,90"][!UpdateMeter MeterBack][!Redraw]
GIF.gif
So I can move the start of the input over a bit, without a jarring transition in color / transparency.
CaGhOsT
Posts: 2
Joined: August 7th, 2017, 9:01 am

Re: Inputtext solid color and font color opacity problem

Post by CaGhOsT »

THX a bunch man

This is what I came up with in the end:
https://drive.google.com/file/d/0B0TnKXR1EUNCaC1RT3lLbllpa3c/view?usp=sharing

Sorry idk how to embed these gifs and also i think theres an upload limit of 5 MB this gif is about 12 MB I think( It could've been compressed but it looked ugly)
Last edited by CaGhOsT on August 7th, 2017, 3:28 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Inputtext solid color and font color opacity problem

Post by jsmorley »

Glad to help.
Post Reply