v1.0.1
v2.0.0
So before diving in a few pros and cons:
Pros:
- Nested contexts
- Highly customizable
- Static or dynamic menu items, with in-context variables
- Icons in context menu(highly recommended to use similar icons, preferably from icons8)
- Have to add "Config" parameter to every Bang
- File paths are relative to the custom menu skin path, naturally(Using #ROOTCONFIGPATH# is preferable)
So all you have to do is to make a script measure and add items to it like you do in Rainmeter section.
Code: Select all
[CustomMenu]
Measure=Script
ScriptFile=#ROOTCONFIGPATH#CustomMenu\CustomMenu.lua
; ----------------- Context options
Title1 = <title1>
Icon1 = <path2icon1>
Option1 = <option1>
Title2 = <title2>
Icon1 = <path2icon2>
Option2 = <option2>
;; ----------------- Nested context menu
Title3 = <title3>
Icon1 = <path2icon3>
Title3Subtitle1 = <subcontext3title1>
Title3Icon1 = <subcontext3icon1>
Title3Option1 = <subcontext3option1>
Title3Subtitle2 = <subcontext3title2>
Title3Icon2 = <subcontext3icon2>
Title3Option2 = <subcontext3option2>
...
Title3Subtitle6 = <subcontext3title6>
Title3Icon6 = <subcontext3icon6>
Title3Option6 = <subcontext3option6>
;; -----------------------------------
...
;; ---------------- Divider (Use --- as TitleN)
Title7 = ---
;; -----------------------------------
...
Title15 = <title15>
Icon15 = <path2icon15>
Option15 = <option15>
UpdateDivider = -1
Now how to call it:
Code: Select all
RightMouseUpAction=[!ActivateConfig "#ROOTCONFIG#\CustomMenu"]
- So, in v2, you can have different measures(preferably Calc or String) and define context options in them. Then call the function Make('measureName') to make a new context menu right away.
For example:P.S.: You have to call "Initialize()" if you used "Make('someMeasure')" to show the context menu in parent measure. And while using Make(), always use single quotes, e.g Make('measureName').and you can call it by:Code: Select all
; main function [CustomMenu] Measure=Script Script=#ROOTCONFIGPATH#CustomMenu\CustomMenu.lua UpdateDivider=-1 [ThemeSelector] Measure=Calc Title1=Dark Title2=Solarized Light Title3=Material Dark Option1=[!WriteKeyValue Variables Theme "Dark" "#@#UserSettings.inc"][!Refresh "#CURRENTCONFIG#"] Option2=[!WriteKeyValue Variables Theme "SolarizedLight" "#@#UserSettings.inc"][!Refresh "#CURRENTCONFIG#"] Option3=[!WriteKeyValue Variables Theme "MaterialDark" "#@#UserSettings.inc"][!Refresh "#CURRENTCONFIG#"]
Code: Select all
[ThemeSelectorMeter] ... LeftMouseUpAction=[!CommandMeasure CustomMenu "Make('ThemeSelector')"][!ActivateConfig "#ROOTCONFIG#\CustomMenu"]
- Another is in-context variables. You can dynamically change what to change.
Syntax:P.S.:Code: Select all
[MeasureName] ... ; for N between 1 and 9 VariableN=<some string> TitleX=<some string> $N <some string> OptionX=<some string> $N <some string>
- This is not valid for IconN or TitleXIconN options.
- You can have total 9 variables, from Variable1 to Variable9
- To use $N as is, escape it with backslash("\"), e.g. "\$1" will be written "$1", without the quotes.
For example:Now you can do thing like:Code: Select all
[CustomMenu] Measure=Script ScriptFile=#ROOTCONFIGPATH# UpdateDivider=-1 Variable1= Variable2=#CURRENTCONFIG# Variable3=#CURRENTPATH##CURRENTFILE# Title1=Calibri Title2=Noto Sans Title3=Roboto Icon1=#@#Icons\font Icon2=#@#Icons\font Icon3=#@#Icons\font Option1=[!SetOption $1 FontFace "Calibri" "$1"][!WriteKeyValue $1 FontFace "Calibri" "$2"][!UpdateMeter "$1" "$2"][!Redraw "$2"] Option2=[!SetOption $1 FontFace "Noto Sans" "$1"][!WriteKeyValue $1 FontFace "Calibri" "$2"][!UpdateMeter "$1" "$2"][!Redraw "$2"] Option3=[!SetOption $1 FontFace "Roboto" "$1"][!WriteKeyValue $1 FontFace "Calibri" "$2"][!UpdateMeter "$1" "$2"][!Redraw "$2"]
Code: Select all
[MeterX] ... RightMouseUpAction=[!SetOption CustomMenu Variable1 "#CURRENTSECTION#"][!CommandMeasure CustomMenu "Initialize()"][!ActivateConfig "#ROOTCONFIG#\CustomMenu"] [MeterY] ... RightMouseUpAction=[!SetOption CustomMenu Variable1 "#CURRENTSECTION#"][!CommandMeasure CustomMenu "Initialize()"][!ActivateConfig "#ROOTCONFIG#\CustomMenu"] [MeterZ] ... RightMouseUpAction=[!SetOption CustomMenu Variable1 "#CURRENTSECTION#"][!CommandMeasure CustomMenu "Initialize()"][!ActivateConfig "#ROOTCONFIG#\CustomMenu"]
Edit the CustomMenu.style file to change the appearance of the menu. All the variables and meter styles are in there. The names are not that confusing. And keep the "*#Scale#"s intact. I will update it later to make them easier to change.
Click to animate
ezgif.com-gif-maker.gif
ASimpleSuite_2.0.1.rmskin
- Nested context going off screen, now it stays within work area(multi monitor support not yet, cause I have only one lol).
- No executables this time, added a plugin instead for the purpose.
- Lessen the amount of activation syntax.
- v2 perks stated above
- Fixed a bug with keeping the menu inside workarea horizontally.