It is currently March 29th, 2024, 10:12 am

Image hover Set option thing

Get help with creating, editing & fixing problems with skins
User avatar
Alloutofmercy
Posts: 142
Joined: November 17th, 2021, 5:51 am

Image hover Set option thing

Post by Alloutofmercy »

So I saw a skin, in which if you hover over some text, an image is visible. So then I tried replicating the same in mine using an image but I dont know what I am doing wrong

Code: Select all

[Appchrome]
Meter=image
Imagename=#@#\Icons\icons8-chrome-48
X=60
Y=220
W=30
LeftMouseUpAction=["Chrome.exe"]
MouseOverAction=[!SetOption #CURRENTSECTION# ][!SetOption GameOverlay ImageName "#AppImage#"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION#][!SetOption GameOverlay ImageName ""][!Update]
Chrome.exe is working fine but when I try with other applications like whatsapp or even operagx it dosent work even if I provide the full path.
All I want is when I hover over the chrome icon, it shows a preview image.
BOOTY
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image hover Set option thing

Post by balala »

Alloutofmercy wrote: November 19th, 2021, 3:13 pm All I want is when I hover over the chrome icon, it shows a preview image.
The first !SetOption bangs in both options, MouseOverAction and MouseLeaveAction, are broken. A such !SetOption bang requires at least three parameters:
  • The name of the section where something has to be modified.
  • The option which has to be modified.
  • The new value which has to be set for the previously specified option.
In your code the [!SetOption #CURRENTSECTION# ] bangs have only one single parameter: the name of the section (#CURRENTSECTION#). No other parameters. If you want to set the #AppImage# image for the current Image meter ([Appchrome]), you have to modify the options for instance this way:

Code: Select all

[Appchrome]
...
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#AppImage#"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName ""][!Update]
I also would tend not to update the whole skin (with the [!Update] bang), which doesn't worth, because when hovering the mouse over or leaving the meter, only the meter itself is modified, but only the current meter. This way:

Code: Select all

[Appchrome]
...
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#AppImage#"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName ""][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
And one more: if my assumption is correct, when leaving the meter, it will disappear, because you set no image anymore to it (setting the ImageName to empty). So probably would be better to do this:

Code: Select all

[Appchrome]
...
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#AppImage#"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName "#@#Icons\icons8-chrome-48"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
Just note here that in order this to work, you have to have an image named icons8-chrome-48, of .png format (the default image format of Rainmeter), into the specified folder (@Resources\Icons\).
User avatar
Alloutofmercy
Posts: 142
Joined: November 17th, 2021, 5:51 am

Re: Image hover Set option thing

Post by Alloutofmercy »

Hey, I Tried and this happened
You do not have the required permissions to view the files attached to this post.
BOOTY
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image hover Set option thing

Post by balala »

Alloutofmercy wrote: November 19th, 2021, 6:20 pm Hey, I Tried and this happened
Not sure what should I look to, what happened.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Image hover Set option thing

Post by death.crafter »

Alloutofmercy wrote: November 19th, 2021, 3:13 pm So I saw a skin, in which if you hover over some text, an image is visible. So then I tried replicating the same in mine using an image but I dont know what I am doing wrong

Code: Select all

[Appchrome]
Meter=image
Imagename=#@#\Icons\icons8-chrome-48
X=60
Y=220
W=30
LeftMouseUpAction=["Chrome.exe"]
MouseOverAction=[!SetOption #CURRENTSECTION# ][!SetOption GameOverlay ImageName "#AppImage#"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION#][!SetOption GameOverlay ImageName ""][!Update]
Chrome.exe is working fine but when I try with other applications like whatsapp or even operagx it dosent work even if I provide the full path.
All I want is when I hover over the chrome icon, it shows a preview image.
I think the skin you are talking about uses some third party plugin to get the app window snaps, which are then shown when mouse overed. It's not something that works out of the box
from the Realm of Death
User avatar
Alloutofmercy
Posts: 142
Joined: November 17th, 2021, 5:51 am

Re: Image hover Set option thing

Post by Alloutofmercy »

Ok, when I refresh I see the chrome icon. In the second image, when I hover over it you can see the tiny preview image.When I stop hovering everything vanishes. Here is the code:-

Code: Select all

[Appchrome]
Meter=image
Imagename=#@#\Icons\icons8-chrome-48.png
X=60
Y=220
W=30
LeftMouseUpAction=["Chrome.exe"]
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#@#\Images\google-search-dark-mode.jpg"][!UpdateMeter "#CURRENTSECTION#"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName ""][!UpdateMeter "#CURRENTSECTION#"][!Update]
BOOTY
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Image hover Set option thing

Post by David8192 »

Alloutofmercy wrote: November 20th, 2021, 6:50 am Ok, when I refresh I see the chrome icon. In the second image, when I hover over it you can see the tiny preview image.When I stop hovering everything vanishes. Here is the code:-

Code: Select all

[Appchrome]
Meter=image
Imagename=#@#\Icons\icons8-chrome-48.png
X=60
Y=220
W=30
LeftMouseUpAction=["Chrome.exe"]
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#@#\Images\google-search-dark-mode.jpg"][!UpdateMeter "#CURRENTSECTION#"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName ""][!UpdateMeter "#CURRENTSECTION#"][!Update]
That is exactly what your MouseLeaveAction is saying. It clears everything.
[!SetOption #CURRENTSECTION# ImageName ""]. You should provide a fallback image in the highlighted quotes. It should look like this:

Code: Select all

[Appchrome]
Meter=image
Imagename=#@#\Icons\icons8-chrome-48.png
X=60
Y=220
W=30
LeftMouseUpAction=["Chrome.exe"]
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#@#\Images\google-search-dark-mode.jpg"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName "#@#\Icons\icons8-chrome-48.png"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
Also note that after !UpdateMeter , the right bang to use is !Redraw
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image hover Set option thing

Post by balala »

David8192 wrote: November 20th, 2021, 9:48 am That is exactly what your MouseLeaveAction is saying. It clears everything.
[!SetOption #CURRENTSECTION# ImageName ""]. You should provide a fallback image in the highlighted quotes. It should look like this:
Correct.
David8192 wrote: November 20th, 2021, 9:48 am Also note that after !UpdateMeter , the right bang to use is !Redraw
In the original code there has been a !Update bang, not !UpdateMeter. As I described in my previous post, !Update updates the whole skin, which assumes a redraw as well, so in this case !Readraw doesn't make sens. But if the !Update is replaced by !UpdateMeter, this bang updates only the meter, but doesn't redraw the skin, so !UpdateMeter requires a !Redraw as well, in order to immediately see the meter updated on the screen.
A few more details here.
User avatar
Alloutofmercy
Posts: 142
Joined: November 17th, 2021, 5:51 am

Re: Image hover Set option thing

Post by Alloutofmercy »

Thanks. Any Idea how I could manipulate the preview image ?
BOOTY
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Image hover Set option thing

Post by David8192 »

Alloutofmercy wrote: November 20th, 2021, 1:45 pm Thanks.

Have the changes worked for you?
Any Idea how I could manipulate the preview image ?
I am not sure I follow.
What would you like to happen to the image?
Last edited by David8192 on November 20th, 2021, 4:12 pm, edited 1 time in total.
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X