It is currently September 18th, 2019, 12:12 am

Meter hiding when other one is active

Help with creating, editing & fixing problems with skins
User avatar
Repo
Posts: 5
Joined: August 31st, 2019, 10:56 am

Meter hiding when other one is active

Repo » August 31st, 2019, 11:18 am

Hi, so basically I trying to create windows search textinput, and it looks like:

Background image with a cutted shape with size of textinput

+

Meter [Box] with text, when TextInput is inactive

+

Meter [SearchButtonInput] with TextInput, that supposed to hide Meter [Box] then I click on it to type in.

I know its not a big deal BUT the background image have 50% opacity, both of meters have also 50% opacity, and when [SearchButtonInput] is active, the [Box] don't want to hide, causing 100% opacity total.

My code:

Code: Select all

[Variables]
Step=1

[MeasureAnimation]
Measure=CALC
Formula=(( MeasureAnimation + #Step# ) % 8 )
Paused=1
IfCondition=((MeasureAnimation=0)||(MeasureAnimation=7))
IfTrueAction=[!PauseMeasure MeasureAnimation]
DynamicVariables=1

[MeterAnimation]
Meter=BITMAP
MeasureName=MeasureAnimation
BitmapImage=#@#Images\search.png
BitmapFrames=8
BitmapExtend=1
MouseOverAction=[!SetVariable Step "1"][!UnpauseMeasure "MeasureAnimation"]
MouseLeaveAction=[!SetVariable Step "-1"][!UnpauseMeasure "MeasureAnimation"]


[Box]

Meter=String
X=46
Y=14
W=456
H=23
StringAlign=Left
FontSize=14
FontFace=Ubuntu
FontColor=140,140,140
SolidColor=255,255,255,130
Text=Search...
LeftMouseUpAction=[!CommandMeasure SearchButtonInput "ExecuteBatch 1-2"]


[SearchButtonInput]
Meter=String
Measure=Plugin
Plugin=InputText.dll
StringAlign=Left
W=456
H=23
X=46
Y=14
FontColor=0,0,0
FontSize=14
FontFace=Ubuntu
BackgroundMode=1
SolidColor=255,255,255,130
DefaultValue=""
Command1=["Explorer" "search-ms:query=$UserInput$"] DefaultValue="Search..."
LeftMouseDownAction=!HideMeter "Box"


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

[Metadata]
Name=search
Author=
Information=
License=
Version=
And this is how it looks like:
Image

I tried to:

Code: Select all

OnFocusAction=[!SetOption Box SolidColor "255,255,255,0"]
but no results...
To infinity, and beyond
User avatar
balala
Rainmeter Sage
Posts: 8620
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Meter hiding when other one is active

balala » August 31st, 2019, 11:46 am

Repo wrote:
August 31st, 2019, 11:18 am
I know its not a big deal BUT the background image have 50% opacity, both of meters have also 50% opacity, and when [SearchButtonInput] is active, the [Box] don't want to hide, causing 100% opacity total.
For this to happen, you have to add proper bangs, into the proper options.
Add the [!HideMeter "#CURRENTSECTION#"][!Redraw] bangs to the LeftMouseUpAction option of the [Box] meter:

Code: Select all

[Box]
...
LeftMouseUpAction=[!CommandMeasure SearchButtonInput "ExecuteBatch 1-2"][!HideMeter "#CURRENTSECTION#"][!Redraw]
and add the [!ShowMeter "Box"][!Redraw] bangs to the Command1 option of the [SearchButtonInput] meter.
Along with the above newly added bangs, you probably might want to add an OnDismissAction=[!ShowMeter "Box"][!Redraw] option to the same [SearchButtonInput] meter as well:

Code: Select all

[SearchButtonInput]
...
Command1=["Explorer" "search-ms:query=$UserInput$"][!ShowMeter "Box"][!Redraw] DefaultValue="Search..."
OnDismissAction=[!ShowMeter "Box"][!Redraw]
User avatar
Repo
Posts: 5
Joined: August 31st, 2019, 10:56 am

Re: Meter hiding when other one is active

Repo » August 31st, 2019, 12:37 pm

Say whaaat... You are amazing man, I spent like 2days to solve it, and you just solved it in few minutes :jawdrop
Thank you so much! There is also like one second pause between switching these meters, do you know how to fix it too? Its not very necessary, but very welcome :D
To infinity, and beyond
User avatar
balala
Rainmeter Sage
Posts: 8620
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Meter hiding when other one is active

balala » August 31st, 2019, 7:37 pm

Repo wrote:
August 31st, 2019, 12:37 pm
Say whaaat... You are amazing man, I spent like 2days to solve it, and you just solved it in few minutes :jawdrop
I'm glad if you got it working as intended.
Repo wrote:
August 31st, 2019, 12:37 pm
There is also like one second pause between switching these meters, do you know how to fix it too? Its not very necessary, but very welcome :D
First fix the following small error of your code: replace the LeftMouseUpAction=[!CommandMeasure SearchButtonInput "ExecuteBatch 1-2"] option of the [Box] meter with the following one: LeftMouseUpAction=[!CommandMeasure SearchButtonInput "ExecuteBatch 1"]. You have to do this because there are no two Command options into the [SearchButtonInput] measure, just one single. Please try this out and let me know if it did help.
Note one more error in the original code: remove the Meter=String option from the [SearchButtonInput] section, because this section is a Plugin measure (as stated into the Measure=Plugin option), not s String meter.
User avatar
Repo
Posts: 5
Joined: August 31st, 2019, 10:56 am

Re: Meter hiding when other one is active

Repo » August 31st, 2019, 7:56 pm

Ah yes, the first one is leftover from previous experiments, actually the second one too :lol:
It didn't help, its still looks like that:

Image
To infinity, and beyond
User avatar
balala
Rainmeter Sage
Posts: 8620
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Meter hiding when other one is active

balala » August 31st, 2019, 8:06 pm

Repo wrote:
August 31st, 2019, 7:56 pm
It didn't help, its still looks like that:
Unfortunately I have no more ideas. I suppose there is something related to how the InputText plugin does work, but not being a developer, I don't know precisely.
Maybe someone else does have an idea?
User avatar
Repo
Posts: 5
Joined: August 31st, 2019, 10:56 am

Re: Meter hiding when other one is active

Repo » August 31st, 2019, 8:32 pm

balala wrote:
August 31st, 2019, 8:06 pm
Unfortunately I have no more ideas. I suppose there is something related to how the InputText plugin does work, but not being a developer, I don't know precisely.
Maybe someone else does have an idea?
Alright man! Thank you very much :D I'll leave this topic as is, maybe someone will help 8-)
To infinity, and beyond
User avatar
balala
Rainmeter Sage
Posts: 8620
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Meter hiding when other one is active

balala » August 31st, 2019, 8:35 pm

Repo wrote:
August 31st, 2019, 8:32 pm
Alright man! Thank you very much :D I'll leave this topic as is, maybe someone will help 8-)
Yes, probably someone will in the near future.
mak_kawa
Posts: 242
Joined: December 30th, 2015, 9:47 am

Re: Meter hiding when other one is active

mak_kawa » August 31st, 2019, 9:41 pm

Just an idea, did not try actually, but I have took the method like this in my search bar skin.

Add [!SetOption Box Text "Search..."][!UpdateMeter Box] to the end of the Command1= line of [SearchButtoInput] measure.
And, add OnDismissAction=[!SetOption Box Text "Search..."] to [SearchButtoInput].
Also, remove LeftMouseDownAction=!HideMeter "Box" from [SearchButtoInput]

Further, modify the LeftMouseUpAction= line in [Box] meter to LeftMouseUpAction=[!CommandMeasure SearchButtonInput "ExecuteBatch 1"][!SetOption Box Text ""][!UpdateMeter Box].

I am sorry if I completely misunderstand your intention, and of course, if my suggestion is wrong and does not work.
User avatar
Repo
Posts: 5
Joined: August 31st, 2019, 10:56 am

Re: Meter hiding when other one is active

Repo » September 1st, 2019, 9:49 am

mak_kawa wrote:
August 31st, 2019, 9:41 pm
Just an idea, did not try actually, but I have took the method like this in my search bar skin.

Add [!SetOption Box Text "Search..."][!UpdateMeter Box] to the end of the Command1= line of [SearchButtoInput] measure.
And, add OnDismissAction=[!SetOption Box Text "Search..."] to [SearchButtoInput].
Also, remove LeftMouseDownAction=!HideMeter "Box" from [SearchButtoInput]

Further, modify the LeftMouseUpAction= line in [Box] meter to LeftMouseUpAction=[!CommandMeasure SearchButtonInput "ExecuteBatch 1"][!SetOption Box Text ""][!UpdateMeter Box].

I am sorry if I completely misunderstand your intention, and of course, if my suggestion is wrong and does not work.
Thanks for advice, but @balala was closer :)
To infinity, and beyond