It is currently March 29th, 2024, 7:22 am

Weird MouseOver behavior.

Get help with creating, editing & fixing problems with skins
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Weird MouseOver behavior.

Post by kyriakos876 »

Hello, I'm making a skin with a little bit of animation that is pretty much a launcher where you will click a meter and that will run a program/app installed on your PC. Now I need to explain that when the mouse is over a meter it will change a text to displaying what the mouse is over, so for example, in the picture the mouse is over the Youtube meter so the text changes to "Youtube"
example.png
same happens if the mouse is over the other meters respectively. If you download the skin attached and see how the skin works, if I mouseover the "G" meter to display the other meters, the text normally says "apps" which is the default state before mousing over anything (this is reset to say "apps" everytime the meters go invisible). Sometimes when I approach the skin from the right to the left this text will display "Photoshop" instead of "Apps" even-though I haven't MouseOver the photoshop meter yet. I tried but couldn't find out why. Any help is welcome.

-Thanks in advance.
You do not have the required permissions to view the files attached to this post.
Last edited by kyriakos876 on April 5th, 2018, 2:27 pm, edited 2 times in total.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weird MouseOver behavior.

Post by jsmorley »

The issue seems to be that as the panel, and the associated app icons are "sliding down", the Photoshop icon, the one on the far left, is crossing over the position of the mouse cursor as it slides down. So its mouse over action is triggered.

I'll have to chew on the solution, but you might start looking there.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Weird MouseOver behavior.

Post by kyriakos876 »

jsmorley wrote:The issue seems to be that as the panel, and the associated app icons are "sliding down", the Photoshop icon, the one on the far left, is crossing over the position of the mouse cursor as it slides down. So its mouse over action is triggered.

I'll have to chew on the solution, but you might start looking there.
Oh yea.... that is obviously it, no need to search any further. I even feel stupid for not thinking of this. Thanks <3
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weird MouseOver behavior.

Post by jsmorley »

I would be tempted to put a MouseLeaveAction on each icon, that sets the text back to "Apps".

Might not be perfect though, as you will likely still get a "flash" of the Photoshop text for a few milliseconds.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Weird MouseOver behavior.

Post by kyriakos876 »

jsmorley wrote:I would be tempted to put a MouseLeaveAction on each icon, that sets the text back to "Apps".

Might not be perfect though, as you will likely still get a "flash" of the Photoshop text for a few milliseconds.
Yea I tried that too and I indeed get a flickering as it changes.

I tried something like
MouseOverAction=((#HOffSet#=180) ? ([!SetOption MeterText Text #B1Text#]#U#) : [])

but I think syntax doesn't work here or I can't have dynamic MouseOverActions. Either way, it doesn't work for some reason.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weird MouseOver behavior.

Post by jsmorley »

kyriakos876 wrote:Yea I tried that too and I indeed get a flickering as it changes.

I tried something like
MouseOverAction=((#HOffSet#=180) ? ([!SetOption MeterText Text #B1Text#]#U#) : [])

but I think syntax doesn't work here or I can't have dynamic MouseOverActions. Either way, it doesn't work for some reason.
You can't use anything but numeric values in a formula. A conditional formula like that evaluates numbers and returns a number.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weird MouseOver behavior.

Post by jsmorley »

The root of the issue is that MouseOverAction is kinda borked when meters overlap. This demonstrates:

Code: Select all

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

[Variables]

[MeterOne]
Meter=Image
W=100
H=100
SolidColor=255,0,0,255
MouseOverAction=[!SetOption MeterText Text "MeterOne"][!UpdateMeter *][!Redraw]

[MeterTwo]
Meter=Image
X=50
Y=50
W=100
H=100
SolidColor=0,255,0,255
MouseOverAction=[!SetOption MeterText Text "MeterTwo"][!UpdateMeter *][!Redraw]

[MeterText]
Meter=String
Y=10R
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=No Meter
In effect, both MouseOverActions are fired where meters overlap. Then which one "wins" is all down to the direction you come at this skin from.

The best solution is to not have the MouseOverAction set on the icons until after they have fully slid down to their final position.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Weird MouseOver behavior.

Post by kyriakos876 »

jsmorley wrote: The best solution is to not have the MouseOverAction set on the icons until after they have fully slid down to their final position.
I know, I'm trying to figure out a way that doesn't include adding 10 more measures and action timers. I found a way but It's stupid and makes the whole thing lag, so I'm tyring now something with nesting variables that uses the name of the section to set the actions when the animation is complete.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weird MouseOver behavior.

Post by jsmorley »

Might be able to do something with a single Calc measure that evaluates the Y position of that single left-hand icon with an IfCondition, and uses !SetOption to remove the MouseOverAction if it isn't the maximum, and to the real bang if it is.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Weird MouseOver behavior.

Post by kyriakos876 »

Now I'm facing other issues.... I tried this:

[#CURRENTSECTIO[#Def]]

and I set Def=N

This should become [#CURRENTSECTION] and then return the sections name, but instead it returns blank. Why?