It is currently April 27th, 2024, 10:18 pm

Custom Context Menu

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom Context Menu

Post by Yincognito »

BaconCR wrote: January 12th, 2024, 3:24 amHi, I tried that option but it's not working.
It is working, actually. And it's ingenious too:
Test_1.0.0.rmskin
So, you must have done something wrong earlier.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Custom Context Menu

Post by eclectic-tech »

BaconCR wrote: January 12th, 2024, 3:24 am Hi, I tried that option but it's not working. When I double click it opens the program instead of loading the next variant.
You need to use a different mouse action because you have LeftMouseUpAction= in other code sections that react to the first mouse click action.

Try using MiddleMouseUpAction= instead of DoubleMouseClickAction= in the bang...
MiddleMouseUpAction=[!ActivateConfig "#CurrentConfig#"]

Note: Since there may be a 'space' in the #CurrentConfig# name, it is a good practice to enclose the parameter in quotation marks.
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: Custom Context Menu

Post by Aryx »

eclectic-tech wrote: January 12th, 2024, 1:10 am LeftMouseDoubleClickAction=[!ActivateConfig #CURRENTCONFIG#] (note there is no INI file specified).
Add this to the [Rainmeter] section of each skin variant.

With that code, when you double-left-click the skin, the currently loaded variant will be unloaded, and the next variant will be loaded. This works since only 1 variant in the same folder can be active at any time.
Sorry for the intrusion, but can I know how/why is the skin "unloading"?
I get that this is a trick, and a pretty good one too, and a magician never reveals the trick , but I need to know! :ThinkingBig
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom Context Menu

Post by Yincognito »

Aryx wrote: January 12th, 2024, 2:48 pmhow/why is the skin "unloading"?
My apologies for answering a question asked to eclectic-tech, but since I'm able to answer...

In this case, it's just the way skin variants are functioning:
1) only one variant may be loaded at one time, so the old one is unloaded when the new one is loaded
https://docs.rainmeter.net/manual/getting-started/using-rainmeter/#Variants
2) when the variant file is not specified, the next variant from the skin folder is loaded instead:
https://docs.rainmeter.net/manual/bangs/#ActivateConfig
Therefore, the particularities of 1) and 2) make the "magic" of iterating between variants happen. 8-)

As for the how, skins are just windows created by Rainmeter on the screen, so it can control them:
https://github.com/rainmeter/rainmeter/blob/55b75a812f531aaf7510c66aef732a785a3e1302/Library/Rainmeter.cpp#L1072
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: Custom Context Menu

Post by Aryx »

Well, y'all make it sound easy... Thanks for telling (even if it would have been obvious).

PS:
I feel I should read things twice before posting - but here the case earlier was that the images too pointed towards the ususal and brain says - do it; So, I did. :?
I don't understand C++, except for simple imports and seriously basic things.............. go figure! :phhht
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom Context Menu

Post by Yincognito »

Aryx wrote: January 12th, 2024, 6:48 pmPS:
I feel I should read things twice before posting - but here the case earlier was that the images too pointed towards the ususal and brain says - do it; So, I did. :?
I don't understand C++, except for simple imports and seriously basic things.............. go figure! :phhht
Nah, you're doing just fine - keep it up in the same vein. This is just as much about providing solutions as it is about trying to understand what someone else meant. Anyone can miss some detail once in a while. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
BaconCR
Posts: 5
Joined: January 11th, 2024, 2:22 pm

Re: Custom Context Menu

Post by BaconCR »

Yincognito wrote: January 12th, 2024, 1:40 pm It is working, actually. And it's ingenious too:
Test_1.0.0.rmskin
So, you must have done something wrong earlier.
I tried the skin you created and it works. My problem the problem was that I had the LeftMouseClick set to open a program, so just with the first click it opens the program and it doesn't switch the variant.But eclectic-tech suggested using the MiddleMouseClick and I had it to deactivate the config, but I really wasn't even using that action, so I replace it and it's working now!! I really want to thank you and everyone here for the support. You guys are Awesome!! Basically what I'm doing is customizing BigSur to my personal preferences and needs. I'll share the results later :D :D
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom Context Menu

Post by Yincognito »

BaconCR wrote: January 13th, 2024, 12:56 pm I tried the skin you created and it works. My problem the problem was that I had the LeftMouseClick set to open a program, so just with the first click it opens the program and it doesn't switch the variant.But eclectic-tech suggested using the MiddleMouseClick and I had it to deactivate the config, but I really wasn't even using that action, so I replace it and it's working now!! I really want to thank you and everyone here for the support. You guys are Awesome!! Basically what I'm doing is customizing BigSur to my personal preferences and needs. I'll share the results later :D :D
Sure thing, we're all glad that you're finally able to do what you wanted - albeit in a slightly different form than originally thought. Enjoy! :great:

P.S. By the way, if you have space for it in the skins, you could add some meter of your preference and add the said action there. Then, you'd probably be able to use whatever mouse button or behavior to iterate through variants...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
BaconCR
Posts: 5
Joined: January 11th, 2024, 2:22 pm

Re: Custom Context Menu

Post by BaconCR »

Yincognito wrote: January 13th, 2024, 2:31 pm Sure thing, we're all glad that you're finally able to do what you wanted - albeit in a slightly different form than originally thought. Enjoy! :great:

P.S. By the way, if you have space for it in the skin, you could add some meter of your preference and add the said action there. Then, you'd probably be able to use whatever mouse button or behavior to iterate through variants...
Yup! But I think it's even better, cause with that MiddleMouse I don't even need to go to the menu, it's even faster! :D :D