Page 1 of 1

Custom Column for file-icon

Posted: 21 Aug 2019 12:51
by MBaas
How can I show the icon that XY shows in the name-colum in a separate column?

Re: Custom Column for file-icon

Posted: 12 Sep 2019 11:46
by admin
I don't think you can. Why would you want to do that?

Re: Custom Column for file-icon

Posted: 12 Sep 2019 11:50
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.

Re: Custom Column for file-icon

Posted: 13 Sep 2019 12:18
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
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

Re: Custom Column for file-icon

Posted: 13 Sep 2019 13:31
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)

Re: Custom Column for file-icon

Posted: 13 Sep 2019 13:51
by MBaas
VERY nice, thank you! :appl:

Re: Custom Column for file-icon

Posted: 13 Sep 2019 14:18
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.

Re: Custom Column for file-icon

Posted: 13 Sep 2019 14:54
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.