It is currently March 29th, 2024, 3:14 pm

My First Skin Help

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

Re: My First Skin Help

Post by Yincognito »

Nice work! :thumbup: The AV didn't like the EXE on execution, but then this is to be expected with AHK scripts. Other than that, personally, I wouldn't have bothered with scripts (either .lua or .ahk) since most of this is achievable in native Rainmeter, with only the focus a potential problem - but that's just me. Two questions though:
- does this work with "unlimited" nesting levels or is designed just for two, ATM?
- does it account for different directions in which the menu should be displayed, in case the default direction results in an off-screen menu?
These are only questions, not trying to make you work more on it, by the way. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: My First Skin Help

Post by death.crafter »

Yincognito wrote: July 21st, 2021, 4:13 pm I wouldn't have bothered with scripts (either .lua or .ahk) since most of this is achievable in native Rainmeter
With the ahk executable(I thought of signing it, but the Internet showed me a hell ton of indecipherable shit), I don't have much of a choice. I opened a !Focus bang suggestion for that purpose.

About lua, it's just more efficient. I wouldn't bother with Rainmeter logics, not to mention the shortcomings.
Yincognito wrote: July 21st, 2021, 4:13 pm - does this work with "unlimited" nesting levels or is designed just for two, ATM?
- does it account for different directions in which the menu should be displayed, in case the default direction results in an off-screen menu?
1. I can make it up to 3 but more than that would be a total mess, not like it isn't now, just look at the options in the measure lol.

2. That's something I didn't think about. It should be considered. And I got another reason I don't want to implement third level nesting.

Thanks for the suggestions.
from the Realm of Death
User avatar
Yincognito
Rainmeter Sage
Posts: 7031
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

death.crafter wrote: July 21st, 2021, 4:40 pm With the ahk executable(I thought of signing it, but the Internet showed me a hell ton of indecipherable shit), I don't have much of a choice. I opened a !Focus bang suggestion for that purpose.

About lua, it's just more efficient. I wouldn't bother with Rainmeter logics, not to mention the shortcomings.



1. I can make it up to 3 but more than that would be a total mess, not like it isn't now, just look at the options in the measure lol.

2. That's something I didn't think about. It should be considered. And I got another reason I don't want to implement third level nesting.

Thanks for the suggestions.
Sure, I understand. If by any chance you consider 2. maybe the similar formulas for my custom tooltip implementation would be of some use. There are a lot of abbreviations in the variables' names there, but starting P = parent skin (in your case, previous context menu), MS = mouse icon size, and all the CURRENTCONFIG variables refer to tooltips (in your case, current context menu). The meaning of X, Y, W, H are quite obvious.

That being said, here is my approach regarding fonts as well, not involving any menus, let's call it "Font Chooser" (I guess this can be incorporated into any skin):

Code: Select all

[Variables]
Cleaner="(?:^[^[\x200B]].*|.*[^[\x200B]]$)":"","(?:^[\x200B]|[\x200B]$)":"","(?:^\\\d+|\\\d+$)":""
FontIndex=0

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures---

[FontList]
Measure=Plugin
Plugin=RunCommand
Parameter=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /s
State=Hide
OutputType=ANSI
Timeout=5000
RegExpSubstitute=1
Substitute="(?si)(?:^.*\\Fonts(?=\R)|(?<=\n)\h*|(?: \(\S*Type\)|REG_SZ)\N*|(?<=\N)\R*$)":""
FinishAction=[!SetVariable FontIndex 0][!UpdateMeasureGroup FontListGroup][!UpdateMeter FontName][!Redraw]
DynamicVariables=1

[FontCountFormula]
Group=FontListGroup
Measure=String
String="[FontList]"
UpdateDivider=-1
RegExpSubstitute=1
Substitute="\N":"","\R":"+1"
DynamicVariables=1

[FontCount]
Group=FontListGroup
Measure=Calc
Formula=[FontCountFormula]
UpdateDivider=-1
DynamicVariables=1

[FontFace]
Group=FontListGroup
Measure=String
String="[FontList]"
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?si)^(?:\R\N*){[#FontIndex]}\R(\N*).*$":"[\x200B]\1[\x200B]","#Cleaner#"
DynamicVariables=1

---Meters---

[GetFonts]
Meter=String
Y=0r
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
Text="Get Fonts (click)"
UpdateDivider=-1
LeftMouseUpAction=[!CommandMeasure FontList "Run"]
DynamicVariables=1

[FontName]
Meter=String
Y=0R
FontFace=[FontFace]
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=FontFace
Text="Font Name (scroll) = %1"
UpdateDivider=-1
MouseScrollUpAction=[!SetVariable FontIndex (([FontCount]+#FontIndex#+1)%[FontCount])][!UpdateMeasure FontFace][!UpdateMeter FontName][!Redraw]
MouseScrollDownAction=[!SetVariable FontIndex (([FontCount]+#FontIndex#-1)%[FontCount])][!UpdateMeasure FontFace][!UpdateMeter FontName][!Redraw]
DynamicVariables=1
Font Chooser.jpg
This would probably be fitted to Community Tips & Tricks section as well, but I'm just too lazy today to place it there, not to mention it's just too simple to warrant such an inclusion, from my POV.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: My First Skin Help

Post by death.crafter »

Yincognito wrote: July 21st, 2021, 5:32 pm Sure, I understand. If by any chance you consider 2. maybe the similar formulas for my custom tooltip implementation would be of some use. There are a lot of abbreviations in the variables' names there, but starting P = parent skin (in your case, previous context menu), MS = mouse icon size, and all the CURRENTCONFIG variables refer to tooltips (in your case, current context menu). The meaning of X, Y, W, H are quite obvious.
I went around a bit but I almost do the same thing.

Here is my approach:
Main skin:

Code: Select all

RightMouseUpAction=[!WriteKeyValue Variables MouseX "([#CURRENTCONFIGX]+$MouseX$)" "#ROOTCONFIGPATH#\CustomMenu\CustomMenu.ini"][!WriteKeyValue Variables MouseY "([#CURRENTCONFIGY]+$MouseY$)" "#ROOTCONFIGPATH#\CustomMenu\CustomMenu.ini"][!ActivateConfig "#ROOTCONFIG#\CustomMenu"]
ContextSkin:

Code: Select all

OnRefreshAction=[!Move "(#MouseX# < #SCREENAREAWIDTH#-(#ContextWidth#+#SubContextWidth#+#SubContextBoxXOffset#) ? #MouseX# : (#MouseX#-#SubContextWidth#-#SubContextBoxXOffset#))" "#MouseY#" #CURRENTCONFIG#][!Delay 100]["#CURRENTPATH#CustomMenu.exe" "#CURRENTPATH##CURRENTFILE#"]
The containers have similar co-ordinates.

Thanks again for the correction :D
from the Realm of Death
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: My First Skin Help

Post by Active Colors »

Yincognito wrote: July 21st, 2021, 5:32 pm Sure, I understand. If by any chance you consider 2. maybe the similar formulas for my custom tooltip implementation would be of some use. There are a lot of abbreviations in the variables' names there, but starting P = parent skin (in your case, previous context menu), MS = mouse icon size, and all the CURRENTCONFIG variables refer to tooltips (in your case, current context menu). The meaning of X, Y, W, H are quite obvious.

That being said, here is my approach regarding fonts as well, not involving any menus, let's call it "Font Chooser" (I guess this can be incorporated into any skin):

This would probably be fitted to Community Tips & Tricks section as well, but I'm just too lazy today to place it there, not to mention it's just too simple to warrant such an inclusion, from my POV.
Simplicity should not be overlooked. Very nice work ;)
User avatar
Yincognito
Rainmeter Sage
Posts: 7031
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

death.crafter wrote: July 21st, 2021, 5:46 pm I went around a bit but I almost do the same thing.

Here is my approach:
Main skin:

Code: Select all

RightMouseUpAction=[!WriteKeyValue Variables MouseX "([#CURRENTCONFIGX]+$MouseX$)" "#ROOTCONFIGPATH#\CustomMenu\CustomMenu.ini"][!WriteKeyValue Variables MouseY "([#CURRENTCONFIGY]+$MouseY$)" "#ROOTCONFIGPATH#\CustomMenu\CustomMenu.ini"][!ActivateConfig "#ROOTCONFIG#\CustomMenu"]
ContextSkin:

Code: Select all

OnRefreshAction=[!Move "(#MouseX# < #SCREENAREAWIDTH#-(#ContextWidth#+#SubContextWidth#+#SubContextBoxXOffset#) ? #MouseX# : (#MouseX#-#SubContextWidth#-#SubContextBoxXOffset#))" "#MouseY#" #CURRENTCONFIG#][!Delay 100]["#CURRENTPATH#CustomMenu.exe" "#CURRENTPATH##CURRENTFILE#"]
The containers have similar co-ordinates.

Thanks again for the correction :D
Very good - if it works well, then you got it. :great:
I didn't correct you in any way, this time (unless you talk about the impossibility of built-in nested context menus in Rainmeter, that is) - the latter post was just an offer to help with the formulas, in case you didn't work on those yet. But since you did it already, it's all good - I truly believe that one should go first with his own approach, if that approach is feasible and all that, if not for anything, because it's easier to understand own code than other's. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: My First Skin Help

Post by death.crafter »

Yincognito wrote: July 21st, 2021, 6:40 pm (unless you talk about the impossibility of built-in nested context menus in Rainmeter, that is)
Though not impossible, I wouldn't want three or four configs to make one context menu. It's just inefficient in my opinion. If you are referring to the JSMorley guide that is.
from the Realm of Death
User avatar
Yincognito
Rainmeter Sage
Posts: 7031
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

death.crafter wrote: July 21st, 2021, 6:59 pmThough not impossible, I wouldn't want three or four configs to make one context menu. It's just inefficient in my opinion. If you are referring to the JSMorley guide that is.
I agree, but I was not referring to that, in this context. I was referring to what you said here, which was basically saying that built-in (as in already provided by Rainmeter's native options) nested custom menus were possible. They are not (which is why we have to build them ourselves), as we could see. That was the only time when I "corrected" you here, since you mentioned it. :D
Active Colors wrote: July 21st, 2021, 5:57 pm Simplicity should not be overlooked. Very nice work ;)
Thanks. Maybe I'll post it there too, when I'm in the mood for it. Unlike on "regular threads", I have to think of every little detail and be 100% professional when I post there, so it's a bit of a "stress" for my laid-back style, LOL.

Anyway, in case the OP is interested, here's the "Font Chooser" at work in his own skin (well, it could be better, especially regarding positioning since those fonts are sometimes placed higher and sometimes lower, but it's all about doing it along similar lines):
BasicDualTemperature_1.0.2.rmskin
DualTemp.jpg
Scrolling on "Font: ..." changes the font, iterating though all installed fonts in the OS. Scrolling on the temperature resizes the skin as usual. Middle clicking on the temperature toggles the hiddens state of the "Font: ..." meter / text, for conveniency. Didn't "shift" the temperature upwards when hiding the font text, it seemed better to do it that way.

P.S. Since the used font is based on the list of installed fonts in the system, its "index" would have to be slightly updated after installing new fonts in Windows. Not a big deal, probably just a matter of a couple of mouse scrolls, depending on the amount of new fonts.

P.S.S. Obviously, browsing through fonts can be done in other ways too, not just by mouse scrolling - for example by placing some arrow "buttons" and clicking on them. I chose scrolling to navigate through fonts because it would take lots of clicks to get from font 1 to, say, font 100, and since there are a couple of hundred fonts on a regular Windows, you get the idea...
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

Yincognito wrote: July 21st, 2021, 7:19 pm... Anyway, in case the OP is interested, here's the "Font Chooser" at work in his own skin ...
cool! the discussion that produced this is way above my pay-grade, but excellent work (I love the way the temperature displays dynamically update during scrolling).

suggestion : enable the "Font Chooser" into the context menu. IOW, r-clik skin > pick item 'Font Chooser' > skin refreshes as per above > scroll untll desired font and then have skin refresh hiding the 'Font : XXX' display. I know, I speak from a strictly driver pov, and let the mechanics reigh supreme over the can or can't be done stuff. :sly:
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

MourningStar wrote: July 21st, 2021, 8:37 pm cool! the discussion that produced this is way above my pay-grade, but excellent work (I love the way the temperature displays dynamically update during scrolling).

suggestion : enable the "Font Chooser" into the context menu. IOW, r-clik skin > pick item 'Font Chooser' > skin refreshes as per above > scroll untll desired font and then have skin refresh hiding the 'Font : XXX' display. I know, I speak from a strictly driver pov, and let the mechanics reigh supreme over the can or can't be done stuff. :sly:
Thought on this a little more. I have a font app I use to visualize all my fonts because I can only associate very very few fonts with their names. I can call up this skin to do that - I think I may mess around with it and present my second skin - HA!

:17good