It is currently October 12th, 2024, 2:54 am

My First Skin Help

Get help with creating, editing & fixing problems with skins
User avatar
MourningStar
Posts: 300
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

Yincognito wrote: July 20th, 2021, 12:35 am Nope. By the way, you don't have to proceed anymore for the 1st variant I mentioned...
thx - Implemented and works! Although you have 'signed off' for today I post this now (while fresh in my disturbed mind :sly: ) and perhaps it gets addressed by others. Two questions/requests :

1. the fonts displayed in the context menu are not listed in the skin's @Resources\fonts folder. where they come from?

2. Below is image of the context menu as per your last mod. Below that is an image I assembled to convey how I would like to see this context menu function. Is this possible?
You do not have the required permissions to view the files attached to this post.
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: My First Skin Help

Post by death.crafter »

MourningStar wrote: July 20th, 2021, 3:54 am thx - Implemented and works! Although you have 'signed off' for today I post this now (while fresh in my disturbed mind :sly: ) and perhaps it gets addressed by others. Two questions/requests :

1. the fonts displayed in the context menu are not listed in the skin's @Resources\fonts folder. where they come from?

2. Below is image of the context menu as per your last mod. Below that is an image I assembled to convey how I would like to see this context menu function. Is this possible?
1. Those are default fonts packed with Windows.

2. A custom context menu.
from the Realm of Death
User avatar
Yincognito
Rainmeter Sage
Posts: 8421
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

1. Like death.crafter said. If you want your "custom" fonts to be included there, just copy your .TTF / .OTF files in the \@Resources\Fonts subfolder of your skin, like explained here and mentioned by eclectic-tech earlier. If the Fonts subfolder doesn't exist yet, create it, naturally.

2. I knew you liked it to be that way, I would have liked it too. I'm not sure it works to design (unlimited) "nested" context menus in Rainmeter (didn't try that yet), but you can do as death.crafter suggested and use the [!SkinCustomMenu] bang as the 7th ContextAction - along with the appropriate 7th ContextTitle - and see if it works. I personally doubt that since Rainmeter doesn't have a (clear) way of delimiting the "end" of a nested custom context menu from the "main" / "parent" one, but I could be wrong...

EDIT: I just got the chance to test 2. and, as I expected, it doesn't work:

Code: Select all

RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=Location: [@LocationName]
ContextAction=["https://weather.com/weather/today"]
ContextTitle2=Time: [@CurrentObservationTime] [@LocationTimezoneAbbreviation]
ContextAction2=[]
ContextTitle3=Edit Weather Variables
ContextAction3=["#@#WeatherComJSONVariables.inc"]
ContextTitle4="---"
ContextAction4=[]
ContextTitle5=Change Text Color
ContextAction5=["#@#Addons\RainRGB4.exe" "VarName=FontColor" "FileName=#@#Variables.inc"]
ContextTitle6="---"
ContextAction6=[]
; ContextTitle7=Font: #Font1#
; ContextAction7=[!WriteKeyValue Variables Font "#Font1#" "#@#Variables.inc"][!SetVariable Font "#Font1#"][!UpdateMeter *][!Redraw]
ContextTitle7=Fonts
ContextAction7=[!SkinCustomMenu]
ContextTitle8=Font: #Font2#
ContextAction8=[!WriteKeyValue Variables Font "#Font2#" "#@#Variables.inc"][!SetVariable Font "#Font2#"][!UpdateMeter *][!Redraw]
ContextTitle9=Font: #Font3#
ContextAction9=[!WriteKeyValue Variables Font "#Font3#" "#@#Variables.inc"][!SetVariable Font "#Font3#"][!UpdateMeter *][!Redraw]
ContextTitle10="---"
ContextAction10=[]
ContextTitle11="More Actions >>"
ContextAction11=[!SkinMenu]
So, unless I'm missing something here, it looks like you can't nest "child" context menus into "parent" context menus in Rainmeter. :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
MourningStar
Posts: 300
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

Yincognito wrote: July 20th, 2021, 8:07 am... So, unless I'm missing something here, it looks like you can't nest "child" context menus into "parent" context menus in Rainmeter. :???:
So, a little confused here, should I or not use this code. If not work not sure why you post the code, unless you want me to give it a shot. I can do that.

Idea : that 'More Actions > >' option - possible to 'clone' this code for said purposes?

-thank you both
User avatar
Yincognito
Rainmeter Sage
Posts: 8421
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

MourningStar wrote: July 20th, 2021, 5:32 pm So, a little confused here, should I or not use this code. If not work not sure why you post the code, unless you want me to give it a shot. I can do that.

Idea : that 'More Actions > >' option - possible to 'clone' this code for said purposes?

-thank you both
I don't see why you are confused though. What happened was:
- I doubted that nested custom context menus work
- I said you could give it a shot (in case I was wrong)
- I eventually tested whether it works or not, and it didn't (at least for me)
I posted the "not working" bits of code so that others can see or test for themselves (including you) - sort of like a proof. So yes, you can give it a shot as well, if you want. For me it didn't work, and I believe it won't work for anyone, at least in this form. But then, as you probably realize, I'm not all-knowing and I can be wrong sometimes, so who am I to stop folks from trying?

Bottom line, my answer is no, it isn't possible. Unless someone else who knows better says otherwise, the "proof" is there to see (i.e. the last code I posted).

P.S. I also posted the code in order for you to see how you should have approached this, in terms of code. Even if it doesn't work, you can still learn or understand how such things are written. Hopefully I have been clearer this time and the confusion dissappeared. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
MourningStar
Posts: 300
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

Yincognito wrote: July 20th, 2021, 6:33 pm... Hopefully I have been clearer this time and the confusion dissappeared. :D
crystal clear and confusion has disappeared ...
.
Image
User avatar
CodeCode
Posts: 1391
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: My First Skin Help

Post by CodeCode »

Yincognito wrote: July 20th, 2021, 8:07 am So, unless I'm missing something here, it looks like you can't nest "child" context menus into "parent" context menus in Rainmeter. :???:
The devs have stated in the past, that having a sub-context would not inherently be possible to add, to avoid a huge tree of context menus sprawling across the screen. (or to that effect).

But that infers that a plugin designed for that purpose (does not exist yet) 'might' be possible...
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Yincognito
Rainmeter Sage
Posts: 8421
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

MourningStar wrote: July 20th, 2021, 8:42 pm crystal clear and confusion has disappeared ...
.
Image
Excellent! By the way, jsmorley's post here seems to confirm this, since he actually needs to use multiple skins to simulate nested context menus. I doubt you'd have something to gain from trying to use that approach, as it would probably mean more effort than reward, especially since as it is now you can very easily add more fonts in the main context menu.
CodeCode wrote: July 20th, 2021, 9:08 pmThe devs have stated in the past, that having a sub-context would not inherently be possible to add, to avoid a huge tree of context menus sprawling across the screen. (or to that effect).
But that infers that a plugin designed for that purpose (does not exist yet) 'might' be possible...
Many thanks, CodeCode, for confirming this - I wasn't aware of discussions on that topic, so it's good to know something for sure. As you said, a (hypothetical) plugin looks to be the only way this could be achieved, though whether that sort of plugin would be "easy" to write or not I wouldn't be able to tell.

------

Other than that, in the end I suppose it isn't absolutely necessary to use a context menu to choose between fonts. This could be done using an InputText to type the font name manually, it could be placed in a "box-like" meter that you can scroll over to "browse" between fonts, and so on. Even a complete list of system fonts can be obtained through some relatively simple PowerShell or Command Prompt commands like:

Code: Select all

[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
(New-Object System.Drawing.Text.InstalledFontCollection).Families
or

Code: Select all

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /s
or

Code: Select all

Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts'
and processed through some regex substitutions to build a "font variable list" that Rainmeter can then use. But then again, if it's only about 5 or 6 fonts to choose from, it doesn't really worth the effort and the current context menu is the most practical choice for such a case.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
MourningStar
Posts: 300
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

ok, no font menu possible at this time, got it. Decided to return to the basic no-fuss/no-muss version. I'll simply populate the variable.inc file with all my favorite fonts and pick one when I get bored of the current, until such time a menu font picker type code surfaces.

Thx again all contributors ... Image
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: My First Skin Help

Post by death.crafter »

from the Realm of Death