It is currently April 18th, 2024, 5:39 pm

Displaying content when hovering over a skin

Tips and Tricks from the Rainmeter Community
User avatar
Pandora
Posts: 24
Joined: November 4th, 2010, 2:23 pm
Location: East Coast, US

Displaying content when hovering over a skin

Post by Pandora »

Ello folks..

I've been really really busy working on graphics and code for my first foray into a personal Rainmeter desktop, and have come upon a specific type of Rainmeter process I could use some advice on.

Specifically, I would like to replicate a "hover" effect that I've seen in some skins from the WP7 suite of skins from fediaFedia, (which I feel is probably the most cool Suite I've seen so far). The skins in question show a specific type of data all the time, but when you hover over the skin, the content changes to a set of new data.

For example, the Calender skins in that suite. The main content displays the month and date, and then when you hover over the skin, a full 30 day calender shows while the mouse is over the skin. One does not need to click for this effect to occur. From what I have seen, there is more then one way to do this, and I'd like to get some advice from folks here about the most efficient way to produce this effect. I can provide code examples if necessary. I'm not in any rush to get this done, as there are plenty of other things for me to work on, heh.

-Pandora

p.s. I have not forgotten the other stuff I need to post about (that's to you, Kaelri), I just so want to get this first set of skins done. I am halfway there and the graphics are mostly done.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Displaying content when hovering over a skin

Post by poiru »

I personally would group all my meters that need to be shown and hidden depending on the cursor, e.g.:

Code: Select all

[MeterNormal]
...
Group=Normal

[MeterHover]
...
Group=Hover
Then, either in the [Rainmeter] section or under a specifc meter, I would use the !RainmeterHideMeterGroup/!RainmeterShowMeterGroup bangs in combination with MouseOverAction= and MouseLeaveAction= to show and hide the groups of meters.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Displaying content when hovering over a skin

Post by Kaelri »

I'd do it exactly the same way.
User avatar
Pandora
Posts: 24
Joined: November 4th, 2010, 2:23 pm
Location: East Coast, US

Re: Displaying content when hovering over a skin

Post by Pandora »

Interesting..

I do not think I've seen a solution nearly that clean anywhere, or using the "group" thingie. Heh. However, I think this will fit the bill, and I just gotta figure out how to integrate it into an existing .ini file that contains over 1k lines of code (oh the pain).

Thanks, both of you :)

-Pandora
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Displaying content when hovering over a skin

Post by Chewtoy »

That's why you should always use meter-styles. So much easier to do things like this. ;)
I don't think, therefore I'm not.
User avatar
Pandora
Posts: 24
Joined: November 4th, 2010, 2:23 pm
Location: East Coast, US

Re: Displaying content when hovering over a skin

Post by Pandora »

Chewtoy wrote:That's why you should always use meter-styles. So much easier to do things like this. ;)
Bahahaha!

My recent thread elsewhere is rather obviously FOR meter-styles, rather then against. Or to put it another way, your preaching to the choir ;)
plasticup
Posts: 8
Joined: October 7th, 2010, 12:48 pm

Re: Displaying content when hovering over a skin

Post by plasticup »

poiru wrote:I personally would group all my meters that need to be shown and hidden depending on the cursor, e.g.:

Code: Select all

[MeterNormal]
...
Group=Normal

[MeterHover]
...
Group=Hover
Then, either in the [Rainmeter] section or under a specifc meter, I would use the !RainmeterHideMeterGroup/!RainmeterShowMeterGroup bangs in combination with MouseOverAction= and MouseLeaveAction= to show and hide the groups of meters.
Ah, so that's how you define Groups. I always knew it was possible, but never really looked into it. That should shave 15-20 arguments out of my !Bangs
Fawcs
Posts: 4
Joined: December 24th, 2010, 1:56 am

Re: Displaying content when hovering over a skin

Post by Fawcs »

Hi, I'm new here and I've been doing some skins, came across this post and I have some questions.

I made this Gcalendar reader and when I hover my mouse in the title/icon or e-mail it shows the next 3 things in the calendar(with the date, time, etc).

So what I did was (at least I think it is) what you said, assigned to every meter that needs to be hidden when the mouse is over the skin the group=Hover code and in the rainmeter section I put the following:

Code: Select all

[Rainmeter]
.
.
OnRefreshAction=!execute [!RainMeterHideMetergroup Hover]
MouseOverAction=!execute [!rainmetershowMetergroup Hover]
MouseLeaveAction=!execute [!rainmeterhidemetergroup Hover]

but there seems to be a delay whenever I put my mouse on the skin or remove it, it's something like 0.2-0.3 seconds, but you can notice it, is there anyway to fix it?

At first I used a series of Bangs(If I pasted the "hide" variable here it would take 4 lines=P) but there wasn't any delay!

Thanks in forward
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Displaying content when hovering over a skin

Post by JpsCrazy »

Fawcs wrote:Hi, I'm new here and I've been doing some skins, came across this post and I have some questions.

I made this Gcalendar reader and when I hover my mouse in the title/icon or e-mail it shows the next 3 things in the calendar(with the date, time, etc).

So what I did was (at least I think it is) what you said, assigned to every meter that needs to be hidden when the mouse is over the skin the group=Hover code and in the rainmeter section I put the following:

Code: Select all

[Rainmeter]
.
.
OnRefreshAction=!execute [!RainMeterHideMetergroup Hover]
MouseOverAction=!execute [!rainmetershowMetergroup Hover]
MouseLeaveAction=!execute [!rainmeterhidemetergroup Hover]

but there seems to be a delay whenever I put my mouse on the skin or remove it, it's something like 0.2-0.3 seconds, but you can notice it, is there anyway to fix it?

At first I used a series of Bangs(If I pasted the "hide" variable here it would take 4 lines=P) but there wasn't any delay!

Thanks in forward
Raise (or create) a lower update value in the [Rainmeter] section. (The default is 1000, which is one second.)
You'll want to increase the UpdateRate of many of your measures because the lower update value will make the measure update more frequently which can 1.) slow your computer down and 2.) Piss off owners of websites because you're checking them too often (if it's a webparser measure)
Fawcs
Posts: 4
Joined: December 24th, 2010, 1:56 am

Re: Displaying content when hovering over a skin

Post by Fawcs »

Raise (or create) a lower update value in the [Rainmeter] section. (The default is 1000, which is one second.)
You'll want to increase the UpdateRate of many of your measures because the lower update value will make the measure update more frequently which can 1.) slow your computer down and 2.) Piss off owners of websites because you're checking them too often (if it's a webparser measure)
Yes, I'm using Update=1000 on the rainmeter section, so I lower it and adjust the updates on the measures? That brings some other questions that aren't related to this topic, should I create another one?

edit: Actually, no need for a new topic, answered my question=)