It is currently November 29th, 2021, 5:36 am

MouseOverAction Question

Help with creating, editing & fixing problems with skins
e-Nv
Posts: 8
Joined: April 20th, 2010, 1:06 am

MouseOverAction Question

Post by e-Nv »

This is probably an already asked question, but I couldnt find it anywhere.

What I'm looking to do is make a dock, and when you put your cursor over an icon, it will display the name of the application.
Now, Ive got everything set up, and when i hover over the icon, it will display the application name, however when I take the cursor off, the name stays there for about 3 seconds, and is acting very glitchy =/.

heres the relevant code for my problem:

Code: Select all

[Icon1]

Meter=IMAGE
X=30
Y=52
w=50
h=50
AntiAlias=1
ImageName=opera.png
LeftMouseDownAction=!Execute ["C:\Program Files (x86)\Opera\opera.exe"]

MouseOverAction=!execute [!RainmeterShowMeter OperaTitle]
MouseLeaveAction=!execute [!RainmeterHideMeter OperaTitle]

[OperaTitle]
Meter=String
StringAlign=Left
StringStyle=normal
FontColor=255, 255, 255, 150
FontFace=Stonehenge
FontSize=28
AntiAlias=1
X=0
Y=0
Text="opera"
hidden = 1
Dont mind the positioning and everything, it is just a test..
So what im asking is, is this the right way to do it? or is there a better way?

Thanks in advance
User avatar
jsmorley
Developer
Posts: 22414
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MouseOverAction Question

Post by jsmorley »

MouseLeaveAction can be a bit glitchy. It doesn't always "see" that the mouse was moved off of the meter properly unless the mouse is moved off the one meter directly to another meter in the same skin without "leaving" the skin first. There are two ways to make it more reliable:

1) Add another copy of
MouseLeaveAction=!execute [!RainmeterHideMeter OperaTitle]

to the [Rainmeter] section of the skin at the top. That will cause the MouseLeaveAction to be much more reliable. It will however mean you will need one for each meter your are showing/hiding, like

MouseLeaveAction=!execute [!RainmeterHideMeter OperaTitle][!RainmeterHideMeter OfficeTitle][!RainmeterHideMeter PhotohsopTitle]

2) Make each of the meters you are hovering over have a "background". This seems to fix the problem too. I do that like this:

[MeterOpera]
Meter=String
X=0
Y=0
W=100
H=25
SolidColor=0,0,0,2
Text=Whatever
MouseOverAction=!execute [!RainmeterShowMeter OperaTitle]
MouseLeaveAction=!execute [!RainmeterHideMeter OperaTitle]

The "SolidColor" statement, along with an appropriate W and H seems to fix the issue for me.
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: MouseOverAction Question

Post by Alex2539 »

You can also tack on [!RainmeterRedraw] for good measure.
ImageImageImageImage
e-Nv
Posts: 8
Joined: April 20th, 2010, 1:06 am

Re: MouseOverAction Question

Post by e-Nv »

Thanks so much! these 2 in conjunction with each other fixed it up nicely. Now I can start working on the other aspects of my skin :p
User avatar
jsmorley
Developer
Posts: 22414
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MouseOverAction Question

Post by jsmorley »

I updated my response with another alternative before I saw that there were additional posts...
e-Nv
Posts: 8
Joined: April 20th, 2010, 1:06 am

Re: MouseOverAction Question

Post by e-Nv »

ah damn, should have tested it out more, now im getting these 2 bars below 2 of the icons, it hangs around for about a half second before the name of the application comes up. =/
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22414
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MouseOverAction Question

Post by jsmorley »

e-Nv wrote:ah damn, should have tested it out more, now im getting these 2 bars below 2 of the icons, it hangs around for about a half second before the name of the application comes up. =/
What is the Update= line at the top under the [Rainmeter] section set to?
e-Nv
Posts: 8
Joined: April 20th, 2010, 1:06 am

Re: MouseOverAction Question

Post by e-Nv »

at the moment it is set to 200, which seems about right for how long the bars sit there for, but wouldnt it not be very good if its just constantly updating?
User avatar
jsmorley
Developer
Posts: 22414
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MouseOverAction Question

Post by jsmorley »

e-Nv wrote:at the moment it is set to 200, which seems about right for how long the bars sit there for, but wouldnt it not be very good if its just constantly updating?
No, I don't really recommend less than 200.

If you want to zip up your skin, upload it to mediafire.com and post a link here, I will be glad to take a look at it.
e-Nv
Posts: 8
Joined: April 20th, 2010, 1:06 am

Re: MouseOverAction Question

Post by e-Nv »

here you go, everything you need should be in there.

http://www.mediafire.com/?jxnmw0tnyjo