Custom Column for file-icon

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
MBaas
Posts: 580
Joined: 15 Feb 2016 21:08

Custom Column for file-icon

Post by MBaas »

How can I show the icon that XY shows in the name-colum in a separate column?
______________________________________________
Happy user ;-)

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Custom Column for file-icon

Post by admin »

I don't think you can. Why would you want to do that?

jupe
Posts: 2794
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Custom Column for file-icon

Post by jupe »

Well this should work for files only I think, in an icon format scripted custom column:

return <cc_item>;

folders are a bit harder, you could theoretically read the CFI rules from the ini file adapt them and try and apply them though if you were that commited to it, or alternatively just use a placeholder generic icon for all folders.

MBaas
Posts: 580
Joined: 15 Feb 2016 21:08

Re: Custom Column for file-icon

Post by MBaas »

Thanks jupe, works nicely. Unfortunately for files only, as you said - but since I'm not using folder-specific icons, it's not too bad.

The reason I asked for it is shown below: I have a paper-folder which contains the files or repositories I'm currently working on. So I need to see the full path to select them - and added the "Fully Qualified Name" custom column.
13-09-_2019_12-08-15.png
13-09-_2019_12-08-15.png (28.65 KiB) Viewed 913 times
Works nicely, but I found that I also need the icon for quicker navigation. So I added the name column and attempted to make it small width, just wide enough to show the icon. But even though this folder has FVS, that did not survive rescaling across screen sizes etc., so have a separate column with just the icon is much better :)
13-09-_2019_12-18-04.png
13-09-_2019_12-18-04.png (27.34 KiB) Viewed 913 times
______________________________________________
Happy user ;-)

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Custom Column for file-icon

Post by admin »

In the next beta you can use this to make the icons work for folders as well:
return <cc_item_ds>;

"ds" stands for "dirs slashed" and will return a folder path with trailing backslash. This will internally enable the app to retrieve the correct icon for the folder.

BTW, you will see 2 icons for items that contain a ";" in the name. Here is a trick to handle that:
return "|<cc_item_ds>";
(it will use | as separator instead of ; and the empty initial part left of | will just be ignored)

MBaas
Posts: 580
Joined: 15 Feb 2016 21:08

Re: Custom Column for file-icon

Post by MBaas »

VERY nice, thank you! :appl:
______________________________________________
Happy user ;-)

jupe
Posts: 2794
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Custom Column for file-icon

Post by jupe »

if you weren't worried about CFI icons for folders you should have been able to just use a generic folder placeholder like I originally mentioned anyway, something like this:

Code: Select all

  if (exists(<cc_item>) == 2) { return ":showfolders"; } else { return <cc_item>; }
untested though, and probably unneeded now Don has implemented future changes.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Custom Column for file-icon

Post by admin »

This approach can be made quicker using <cc_isfolder>:

Code: Select all

    + Custom Columns: Added variable <cc_isfolder>. It's "1" for folders, "0" for 
      files.

Post Reply