It is currently September 29th, 2024, 9:32 am

In need of some help

General topics related to Rainmeter.
doomkaliber
Posts: 1
Joined: February 3rd, 2016, 2:50 pm

In need of some help

Post by doomkaliber »

Hello! I am very new to the Rainmeter application and have gone on into discovering its capabilities. I am asking for assistance as to a current skin project I am working on, as the Reference Forum/Discussion did not provide me with the information I was looking for, but it's very likely that I am just not searching in the correct places.

I am interested in making invisible menus that are to become active upon a Mouse Hover event. For example, I want to hover an Icon of "Steam" that is to render a sub-menu visual right below it with games that are common for the Steam Application (For example: CS:GO, DotA2 below it, then The Binding of Isaac below that and so on). As I have been theorycrafting it, the best way to go about it is to render the said sub-menu visible with a mouse hover event, and hiding the menu when I hover another Game Nexus Point, such as Battle net, when another sub-menu appears below that Icon. As I am currently working on it I'm trying to use several instances of the Docks feature, but have run into a wall, where I cannot disable and hide the said sub-menus. Here is some of the sample text that I have been toying with while experimenting "LeftMouseDownAction=[!HideMeter Clock]".

Am I going at this in an efficient matter? Any and all feedback is most welcome, as I said I'm really new (literally two days into using Rainemeter). Thank you in advance!
User avatar
balala
Rainmeter Sage
Posts: 16602
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: In need of some help

Post by balala »

doomkaliber wrote:I am interested in making invisible menus that are to become active upon a Mouse Hover event. For example, I want to hover an Icon of "Steam" that is to render a sub-menu visual right below it with games that are common for the Steam Application (For example: CS:GO, DotA2 below it, then The Binding of Isaac below that and so on). As I have been theorycrafting it, the best way to go about it is to render the said sub-menu visible with a mouse hover event, and hiding the menu when I hover another Game Nexus Point, such as Battle net, when another sub-menu appears below that Icon. As I am currently working on it I'm trying to use several instances of the Docks feature, but have run into a wall, where I cannot disable and hide the said sub-menus. Here is some of the sample text that I have been toying with while experimenting "LeftMouseDownAction=[!HideMeter Clock]".
Although this question was discussed a few times and I can't see "the sample text that I have been toying with", here's a short code you can take a look to:

Code: Select all

[Rainmeter]
Update=-1

[Variables]
Menu1Visible=0
Menu2Visible=0

[MenuStyle]
W=100
H=20
FontColor=220,220,220
SolidColor=0,0,0,120
FontSize=12
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=CENTERCENTER
AntiAlias=1
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor "255,240,0"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor "220,220,220"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]

[SubmenuStyle]
W=100
H=20
FontColor=220,220,220
SolidColor=0,0,0,120
FontSize=12
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=CENTERCENTER
AntiAlias=1
Hidden=1
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor "255,240,0"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor "220,220,220"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]

[MeasureMenu1]
Measure=Calc
Formula=#Menu1Visible#
IfCondition=(MeasureMenu1=0)
IfTrueAction=[!HideMeterGroup "Menu1"][!UpdateMeterGroup "Menu1"][!Redraw]
IfFalseAction=[!ShowMeterGroup "Menu1"][!UpdateMeterGroup "Menu1"][!SetVariable Menu2Visible "0"][!

UpdateMeasureGroup "Menus"][!Redraw]
DynamicVariables=1
Group=Menus

[MeasureMenu2]
Measure=Calc
Formula=#Menu2Visible#
IfCondition=(MeasureMenu2=0)
IfTrueAction=[!HideMeterGroup "Menu2"][!UpdateMeterGroup "Menu2"][!Redraw]
IfFalseAction=[!ShowMeterGroup "Menu2"][!UpdateMeterGroup "Menu2"][!SetVariable Menu1Visible "0"][!

UpdateMeasureGroup "Menus"][!Redraw]
DynamicVariables=1
Group=Menus

[MeterMenu1]
Meter=STRING
X=50
Y=10
MeterStyle=MenuStyle
Text=Menu1
MouseOverAction=[!SetVariable Menu1Visible "1"][!UpdateMeasureGroup "Menus"][!Redraw]

[MeterMenu1Hovering]
Meter=Image
SolidColor=0,0,0,1
X=-50r
Y=-10r
W=100
H=110
MouseLeaveAction=[!SetVariable Menu1Visible "0"][!UpdateMeasureGroup "Menus"][!Redraw]

[MeterMenu2]
Meter=STRING
X=160
Y=10
MeterStyle=MenuStyle
Text=Menu2
MouseOverAction=[!SetVariable Menu2Visible "1"][!UpdateMeasureGroup "Menus"][!Redraw]

[MeterMenu2Hovering]
Meter=Image
SolidColor=0,0,0,1
X=-50r
Y=-10r
W=100
H=110
MouseLeaveAction=[!SetVariable Menu2Visible "0"][!UpdateMeasureGroup "Menus"][!Redraw]

[MeterSubmenu11]
Meter=STRING
X=50
Y=40
MeterStyle=SubmenuStyle
Text=Menu11
Group=Menu1

[MeterSubmenu12]
Meter=STRING
X=0r
Y=30r
MeterStyle=SubmenuStyle
Text=Menu12
Group=Menu1

[MeterSubmenu13]
Meter=STRING
X=0r
Y=30r
MeterStyle=SubmenuStyle
Text=Menu13
Group=Menu1

[MeterSubmenu21]
Meter=STRING
X=160
Y=40
MeterStyle=SubmenuStyle
Text=Menu21
Group=Menu2

[MeterSubmenu22]
Meter=STRING
X=0r
Y=30r
MeterStyle=SubmenuStyle
Text=Menu22
Group=Menu2

[MeterSubmenu23]
Meter=STRING
X=0r
Y=30r
MeterStyle=SubmenuStyle
Text=Menu23
Group=Menu2
This code is using two variables (Menu1Visible and Menu2Visible) to show / hide the appropriate submenus: when the value of any of these is 0, the menu isn't visible, while when it's 1, the appropriate menu become visible. Now you have to play with these variables in a way to set the values of these variables according to what menu element are you hovering your mouse to. When you're hovering the mouse over Menu1, the Menu1Visible become 1 (this will show the elements of first submenu), but it'll become 0 again (to hide the submenu), only when you're leaving the [MeterMenu1Hovering] image meter. This last meter must have the same height as the appropriate menu (so when you're modifying the code, be careful to use for the H option of the [MeterMenu1Hovering] a value which is equal with the total height of the [MeterMenu1], [MeterSubmenu11], [MeterSubmenu12] and [MeterSubmenu13]).
Finally you'll have to add to the [MeterSubmenu11], [MeterSubmenu12] and [MeterSubmenu13] respectively [MeterSubmenu21], [MeterSubmenu22] and [MeterSubmenu23] meters the needed LeftMouseUpAction options, to can open the games / apps.