It is currently April 19th, 2024, 12:24 pm

FileView vs FileChoose plugin

Get help with creating, editing & fixing problems with skins
User avatar
Jaime Méndez
Posts: 98
Joined: August 31st, 2022, 10:00 pm

FileView vs FileChoose plugin

Post by Jaime Méndez »

Hello, hope someone can help me. I am unable to get thumbnail image instead of icon from a photo file.

Code: Select all

[Variables]

; INDEX_0=1
TILE_0_X_O=77
TILE_0_Y_O=3
TILE_0_X=(1+(#TILE_0_X_O#-1)*[MeasureTimerCalc:])
TILE_0_Y=(3+(#TILE_0_Y_O#-3)*[MeasureTimerCalc:])
TILE_0_SELECTION=0
; INDEX_1=2
TILE_1_X_O=1
TILE_1_Y_O=102
TILE_1_X=(1+(#TILE_1_X_O#-1)*[MeasureTimerCalc:])
TILE_1_Y=(3+(#TILE_1_Y_O#-3)*[MeasureTimerCalc:])
TILE_1_SELECTION=0
TILE_F_SELECTION=0
Update_Tiles=[!UpdateMeter "MeterTile0"][!UpdateMeter "MeterTileIcon0"][!UpdateMeter "MeterTileText0"][!UpdateMeter "MeterTileSelection0"][!UpdateMeter "MeterTileHitbox0"][!UpdateMeter "MeterTile1"][!UpdateMeter "MeterTileIcon1"][!UpdateMeter "MeterTileText1"][!UpdateMeter "MeterTileSelection1"][!UpdateMeter "MeterTileHitbox1"]
Update=[!UpdateMeasure "MeasureSlide"][!UpdateMeasure "MeasureTimerCalc"][!UpdateMeter "MeterHitbox"]#Update_Tiles#[!Redraw]
FullyOppened=[!UpdateMeter "MeterTileHitbox0"][!UpdateMeter "MeterTileHitbox1"][!Redraw]
ClosingStart=[!UpdateMeter "MeterTileHitbox0"][!UpdateMeter "MeterTileHitbox1"][!Redraw]

TILE_F_X_O=1
TILE_F_Y_O=3


[MeasureFileIcon0]
Measure=Plugin

;Plugin=FileView
Plugin=FileChoose

Path=[MeasureFolder]

UseNewStyle=0
GetTarget=1
AllowNonstorageFolder=1
CopyLink=1
LinkCache=#Path#LinkCache\
GetIcon=3
IconCache=#Path#IconCache\
IconSize=1
ReturnValue=WholePath
FileInitialDirectory=
ImageInitialDirectory=#Path#IconCache\

Index=1
Type=Icon
;IconSize=Large
OnChangeAction=[!SetOption MeterTileIcon0 ImageName [MeasureFileIcon0]]

Command1=[!SetVariable Icon0 "$Icon$"][!Redraw]

[MeasureFileName0]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Index=1
Type=FileName
OnChangeAction=[!SetOption MeterTileText0 Text [MeasureFileName0]]

[MeasureFilePath0]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Index=1
Type=FilePath

[MeterTile0]
Meter=Shape
Shape=Rectangle #TILE_0_X#,#TILE_0_Y#,75,98 | Fill Color 0,0,0,(255*[MeasureTimerCalc:]) | Stroke Color 0, 0, 0, (255*[MeasureTimerCalc:])
DynamicVariables=1

[MeterTileHitbox0]
Meter=Shape
Shape=Rectangle #TILE_0_X_O#,#TILE_0_Y_O#,75,98 | Fill Color 0,0,0,1 | Stroke Color 0, 0, 0, 1
Hidden=(Clamp(Floor(1-[MeasureTimerCalc:]*2),0,1))
DynamicVariables=1


[MeterTileSelection0]
Meter=Shape
Shape=Rectangle (#TILE_0_X#+(#Tile_Width#-#Tiles_Selection_Width#)/2),#TILE_0_Y#,(#Tiles_Selection_Width#),(#Tiles_Text_OY#+[MeterTileText0:H]) | Fill Color #Hover_Selection_Color#,(#Hover_Selection_Opacity#*#TILE_0_SELECTION#*[MeasureTimerCalc:]) | Stroke Color #Hover_Selection_Color#, (#Hover_Selection_Border_Opacity#*#TILE_0_SELECTION#*[MeasureTimerCalc:])
DynamicVariables=1
Hidden=(Floor(1-[MeasureTimerCalc:]))
Group=SelectionGroup
LeftMouseUpAction=["[MeasureFilePath0]"]
MouseOverAction=[!SetVariable TILE_0_SELECTION 1][!UpdateMeter "MeterTileSelection0"][!Redraw]
MouseLeaveAction=[!SetVariable TILE_0_SELECTION 0][!UpdateMeter "MeterTileSelection0"][!Redraw]


[MeterTileIcon0]
Meter=Image

;ImageName=[MeasureFileIcon0]
ImageName=#Icon0#

X=(#TILE_0_X#+#Tiles_Icon_OX#)
Y=(#TILE_0_Y#+#Tiles_Icon_OY#)
W=#Tiles_Icon_Size#
H=#Tiles_Icon_Size#
Container=MeterTile0
DynamicVariables=1

[MeterTileText0]
Meter=String
Text=[MeasureFileName0]
X=(#TILE_0_X#+#Tiles_Text_OX#)
Y=(#TILE_0_Y#+#Tiles_Text_OY#)
ClipStringW=#Tiles_Text_Width#
ClipStringH=#Tiles_Text_Height#
FontColor=255,255,255,255
StringAlign=CenterTop
ClipString=2
FontSize=9.5
AntiAlias=0
; FontFace=Segoe UI
StringEffect=Shadow
FontEffectColor=0,0,0,255
Container=MeterTile0
DynamicVariables=1
Last edited by Brian on August 31st, 2022, 11:57 pm, edited 1 time in total.
Reason: Please use [code] tags. It's the </> button. Thanks.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: FileView vs FileChoose plugin

Post by eclectic-tech »

The code you posted does not include variables and measures needed to test and help with your question.
Post your entire rmskin package may provide the details needed to help you.
thumberrors.png
You do not have the required permissions to view the files attached to this post.
User avatar
Jaime Méndez
Posts: 98
Joined: August 31st, 2022, 10:00 pm

Re: FileView vs FileChoose plugin

Post by Jaime Méndez »

eclectic-tech wrote: September 1st, 2022, 3:05 am The code you posted does not include variables and measures needed to test and help with your question.
Post your entire rmskin package may provide the details needed to help you.
thumberrors.png
Thank you for your response, Someone helped me to work around and instead of trying to rewrite the code in order to use FileChoose plugin instead of FileView.

It is an interesting skin code that expands folders in a very intuitive mode. Unfortunately it won't show thumbnails when folder files are photos or videos, it just shows the icon assigned to its type of file. The code uses FileView plugIn.
I wanted to recode it so it can run with FileChoose plugin instead so it can show photo files thumbnails and not just its icon whenever I mouseover.

You ca find a demo of the skin here: https://youtu.be/WEQzOHPr5ho
And the skin here: https://github.com/juh9870/EXpandableFolder/releases/tag/1.0.0

There is a simpler way to do it since the code uses FileView and recoding it would take more time.

Yincognito (https://forum.rainmeter.net/viewtopic.php?t=33767&hilit=filechoose&start=40#p209648) wrote this:

Here's what you need to do. Open your [SkinFolder]\@Resources\include\tiles.inc.template file in your favorite text editor and:

1) comment the OnChangeAction line in the [MeasureFileIcon%%] measure by adding a ; at the start of the line:

Code: Select all

; OnChangeAction=[!SetOption MeterTileIcon%% ImageName [MeasureFileIcon%%]]
2) add the following after the [MeasureFilePath%%] measure, to get the file type and change the corresponding meter's image name based on whether the type is of an image or not (the full path to the file including the file name and extension if it's an image, or the FileView's created icon files that correspond to the system's icon for that file type):

Code: Select all

[MeasureFileType%%]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Index={%%+1}
Type=FileType
IfMatch=(?i)^(?:png|jpg|bmp|gif|tif|webP|ico)$
IfMatchAction=[!SetOption MeterTileIcon%% ImageName "[MeasureFilePath%%]"]
IfNotMatchAction=[!SetOption MeterTileIcon%% ImageName "[MeasureFileIcon%%]"]
IfMatchMode=1
3) add the following line to the [MeterTileIcon%%] meter, to avoid distorting the thumbnail to match the square shape used by the tiles and display it using its original aspect ratio between the image's width and height:

Code: Select all

PreserveAspectRatio=1
Last edited by balala on September 2nd, 2022, 2:36 pm, edited 1 time in total.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: FileView vs FileChoose plugin

Post by eclectic-tech »

Yes, I saw the discussion in the other thread... glad you were able to describe your ideas and find a possible solution by rendering resized images :thumbup: