It is currently April 23rd, 2024, 7:23 am

Hide group when mouse gets close

Get help with creating, editing & fixing problems with skins
I B Profen
Posts: 1
Joined: March 1st, 2017, 4:49 am

Hide group when mouse gets close

Post by I B Profen »

Hello Everyone,

This is my first post on the forum.
I've run into a problem creating a little tool to hide a few other skins.

I'm using 5 different skins to monitor system status on my second monitor. I would like to have them always on top, so if I can have windows open and still be able to see them. I want them all to fade when the mouse gets near them, should I have to click something underneath them.

I went ahead and put the skins I want to hide into a group "System" and then made a transparent region that covers the area I want them to be hidden when the mouse is present.

This is what I'm using to detect the mouse.

[Border]
Meter=IMAGE
SolidColor=0, 0, 0, 1
X=0
Y=0
H=300
W=750
AntiAlias=1
UpdateDivider=-1
MouseOverAction=!HideFadeGroup "System"
MouseLeaveAction=!ShowFadeGroup "System"

Herein lies my problem. While yes, I succeeded in making the group fade when the mouse gets close, I'm unable to click on anything underneath because in order for the skin to detect the mouse, it cannot be set to click-through.

So essentially, I got them all to fade at once but now I cant click anything underneath that region, which was the big idea to begin with.

I'm aware that checking click-through makes the skin in question completely disregard the mouse. I tried to dig through some forum posts but I was unable to find a solution or workaround.

Thanks in advance for any assistance. :D
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Hide group when mouse gets close

Post by eclectic-tech »

The simplest solution would be to activate a separate skin on MouseOverAction, that will [!ShowFadeGroup System]. This skin should be in a separate folder, not part of the System group. As an example, I'll name it 'ShowSystem.ini' and save it in your skin's root folder. Here is the code for 'ShowSystem.ini:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=SystemControl
OnRefreshAction=!ZPos 2

; ========= Meters ==========
[Border1]
Meter=IMAGE
SolidColor=0,0,0,1
X=0
Y=0
H=#WorkAreaHeight#
W=2
AntiAlias=1
UpdateDivider=-1
MouseOverAction=[!ShowFadeGroup "System"][!DeactivateConfig]
This is a simple image down the left side of your screen. When you mouse over will show the System group skins and deactivate itself. The image can be any shape or location you want, but I find the left screen edge works well and does not interfere with most windows/skins.

I assume you added the [Border] meter to one of your System group skins (that is where it needs to be, so it is hidden by the MouseOverAction). Modify that meter by removing the MouseLeaveAction line and change the MouseOverAction to MouseOverAction=[!HideFadeGroup "System"][!ActivateConfig "#RootConfig#" "ShowSystem.ini"].

Now when you mouse over the border area, all System skins will be hidden and the 'ShowSystem.ini' will activate.
When you are done editing, move your mouse to the left screen edge and the System skins will show, and 'ShowSystem.ini' will close (deactivate).

There may be other ways to achieve this, but this is one option. :)

..:: Addendum ::..
A second option would be to simply create a skin that exists along the left screen edge permanently, and have it toggle fade the System group skins using mouse over or mouse click.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=SystemControl
OnRefreshAction=!ZPos 2

; ========= Meters ==========
[Border1]
Meter=IMAGE
SolidColor=0,0,0,1
X=0
Y=0
H=#WorkAreaHeight#
W=2
AntiAlias=1
UpdateDivider=-1
; Add a semicolon to the next line to disable mouse over and use mouse click below it to toggle
MouseOverAction=[!ToggleFadeGroup "System"]
; Remove the semicolon from the next line to use mouse click rather than mouse over to toggle 
; LeftMouseUpAction=[!ToggleFadeGroup "System"]
There are always different ways to get things done in Rainmeter. :welcome: