It is currently September 8th, 2024, 12:02 am

FileView skin: ToggleConfig CurrentFile

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

Re: FileView skin: ToggleConfig CurrentFile

Post by Yincognito »

sl23 wrote: July 6th, 2024, 5:54 pm One last thing I would like to do, though not essential, is to limit this skins ability to go back past the Skins folder. It opens on the Skins folder and is designed only for use within that folder, but how can I restrict going up past it?

I have tried disabling the Mouse action for going back but that didn't work. Any ideas? :)
Generally speaking, if by "past" you mean towards the parent folder (i.e. back), using ShowDotDot=0 should be enough. If you mean towards the child folders (i.e. foward), then not using [!CommandMeasure "ChildMeasureName" "FollowPath"] in such cases could help.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: FileView skin: ToggleConfig CurrentFile

Post by sl23 »

Sorry yes I meant back.

I have removed the showdotdot, but would like to keep the option to browse within the skins folder but not above it. If that makes sense? :)
57686174 77696C6C 6265 77696C6C 6265
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: FileView skin: ToggleConfig CurrentFile

Post by Yincognito »

sl23 wrote: July 7th, 2024, 8:24 am Sorry yes I meant back.

I have removed the showdotdot, but would like to keep the option to browse within the skins folder but not above it. If that makes sense? :)
It surely does. Well, you could dynamically change the value of the ShowDotDot option and !CommandMeasure the parent to "Update" (using only !UpdateMeasure is not enough!), based on a proper IfMatch on the value of the parent (e.g. if its value contains the skins folder path)... :???:

Be aware that you'll need to regex escape the reserved characters in the said path to compare. I suggest adding a String measure with the skins folder path as its value, and automatically regex escape its value via the :EscapeRegExp parameter for that measure, in the IfMatch comparison:
https://docs.rainmeter.net/manual/variables/section-variables/#EscapeRegExp
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: FileView skin: ToggleConfig CurrentFile

Post by sl23 »

As this is a compact skin, I'm not using the ShowDotDot option.
But am trying to disable/enable mouse action based on this:

Code: Select all

[mPath]
Measure=Plugin
Plugin=FileView
Path="#SkinsPath#"
ShowDotDot=0
HideExtensions=1
Count=10
Group=Children
Substitute="#SkinsPath#":""

[mPath2]
Measure=Plugin
Plugin=FileView
Path="#SkinsPath#"
ShowDotDot=0
HideExtensions=1
Count=10
Group=Children
Substitute="#SkinsPath#":""

[m1]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=Icon
IconSize=#IconSize#
Index=1
Group=Children
IfMatch=[mPath2]
IfMatchAction=[!DisableMouseAction Button "LeftMouseUpAction"]
IfNotMatchAction=[!EnableMouseAction Button "LeftMouseUpAction"]
As per usual, I can't get it to work! :-(

The first [mPath] measure is the one used to define how the whole skin works. The second, [mPath2], is simply to test if the first matches the second then disable mouse action.

When the skin is at the default path, ie, #SkinsPath#, then the About window shows the [mPath] as blank. So the same is set for the [mPath2] measure. so when both are the same disable the Button meter's LeftMouseUpAction. Is it because they are blank that there's no matching? I then tried adding Substitute="#SkinsPath#":"Skins\" to both [mPath] and [mPath2] but still no good. Why doesn't it disable the mouse action? :confused:
57686174 77696C6C 6265 77696C6C 6265
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: FileView skin: ToggleConfig CurrentFile

Post by Yincognito »

sl23 wrote: July 7th, 2024, 5:50 pm As per usual, I can't get it to work! :-(
Yep, obviously. :confused:

How do you even expect the IfMatch to work in a Type=Icon FileView measure?! You'll compare the full path to that icon with [mPath2] which is nothing... I mean, seriously now.

Place the IfMatch in [mPath], compare with ^$ aka the empty string in regex, and get rid of [mPath2], it isn't really needed.

However...
sl23 wrote: July 7th, 2024, 5:50 pm When the skin is at the default path, ie, #SkinsPath#, then the About window shows the [mPath] as blank.
Are you sure [mPath] will be blank only when "the skin is at the default path" (I suppose the default path is the skins folder, cause you didn't mention)? My guess is that it will always be blank, correct me if I'm wrong. If so, I'll let you guess why.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: FileView skin: ToggleConfig CurrentFile

Post by sl23 »

Yeah ok, ok, no need to rub it in! :p

I did try matching mPath and mPath2 but that didn't work so I tried moving the IfMatch, which was a silly place to put it! :lol:

Didn't even think about that! Thanks for the solution. :thumbup:
Last edited by sl23 on July 7th, 2024, 7:13 pm, edited 1 time in total.
57686174 77696C6C 6265 77696C6C 6265
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: FileView skin: ToggleConfig CurrentFile

Post by Yincognito »

sl23 wrote: July 7th, 2024, 7:08 pm Yeah ok, ok, no need to rub it in! :p

Didn't even think about that! Thanks for the solution. :thumbup:
I just added to the post, see the last paragraph.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: FileView skin: ToggleConfig CurrentFile

Post by sl23 »

Haha, ok ta, I know why it's blank, I had to make it blank as I couldn't get the path for CurrentConfig otherwise. Couldn't figure it out! :oops:

Oh, and yes, the #SkinsPath# is the default path.
57686174 77696C6C 6265 77696C6C 6265
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: FileView skin: ToggleConfig CurrentFile

Post by Yincognito »

sl23 wrote: July 7th, 2024, 7:14 pm Haha, ok ta, I know why it's blank, I had to make it blank as I couldn't get the path for CurrentConfig otherwise. Couldn't figure it out! :oops:

Oh, and yes, the #SkinsPath# is the default path.
I didn't refer to that. It will always be blank, no matter what folder you're in...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: FileView skin: ToggleConfig CurrentFile

Post by sl23 »

No it's not, I've been watching it in the About window. It changes with the path and works exactly how I wanted now, thanks to you, again! :thumbup:
57686174 77696C6C 6265 77696C6C 6265