Custom column - Ability to display icon(s)

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

Re: Custom column - Ability to display icon(s)

Post by admin »

I saw it and fixed it. :)

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

Re: Custom column - Ability to display icon(s)

Post by admin »

Next version you can easily convert the file size to something colorful. I added <cc_size> to the Custom Column variables. :cup:

Code: Select all

Snip: CustomColumn 1
  XYplorer 17.80.0001, 22.03.2017 11:11:37
Action
  ConfigureColumn
Caption
  Cize
Type
  3
Definition
  $size = "<cc_size>";
  switch (true){
    case $size == 0: return '';
    case $size < 1024: return ">draw.circle 4, 0088ee, 127";
    case $size < 10 * 1024: return ">draw.circle 8, 0088ee, 127";
    case $size < 100 * 1024: return ">draw.circle 12, 0088ee, 127";
    case $size < 1024 * 1024: return ">draw.circle 16, 0088ee, 127";
    case $size < 10 * 1024 * 1024: return ">draw.circle 16, 0088ee, 127; >draw.circle 4, 0088ee, 192";
    case $size < 100 * 1024 * 1024: return ">draw.circle 16, 0088ee, 127; >draw.circle 8, 0088ee, 192";
    case $size < 1024 * 1024 * 1024: return ">draw.circle 16, 0088ee, 127; >draw.circle 12, 0088ee, 192";
    default: return ">draw.circle 16, 0088ee, 192";
  }
Format
  7
Trigger
  1
Item Type
  0
Item Filter
  
Attachments
Cize.png
Cize.png (52.61 KiB) Viewed 2571 times

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Custom column - Ability to display icon(s)

Post by LittleBiG »

Refresh list messes up the custom column. Refresh column sorts it out.
Attachments
2017-03-22_11h39_28.gif
2017-03-22_11h39_28.gif (698.88 KiB) Viewed 2567 times

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Custom column - Ability to display icon(s)

Post by Filehero »

admin wrote:Next version you can easily convert the file size to something colorful. I added <cc_size> to the Custom Column variables. :cup:
Smart!

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

Re: Custom column - Ability to display icon(s)

Post by admin »

LittleBiG wrote:Refresh list messes up the custom column. Refresh column sorts it out.
Could you post the script?

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Custom column - Ability to display icon(s)

Post by LittleBiG »

admin wrote:
LittleBiG wrote:Refresh list messes up the custom column. Refresh column sorts it out.
Could you post the script?

Code: Select all

if (gettokenindex(<cc_ext>, "exe|bat|xyi", , "i")) > 0 {
  return '>draw.circle 20, ff0000,, 3; 6, 008000;'
}
Edit: As I can see, an else branch is vital, otherwise the return is non-determined.

Code: Select all

if (gettokenindex(<cc_ext>, "exe|bat|xyi", , "i")) > 0 {
  return '>draw.circle 20, ff0000,, 3; 6, 008000;'
} else {
  return ''
}

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

Re: Custom column - Ability to display icon(s)

Post by admin »

LittleBiG wrote:
admin wrote:
LittleBiG wrote:Refresh list messes up the custom column. Refresh column sorts it out.
Could you post the script?

Code: Select all

if (gettokenindex(<cc_ext>, "exe|bat|xyi", , "i")) > 0 {
  return '>draw.circle 20, ff0000,, 3; 6, 008000;'
}
No problems with this over here. There must be sth else going on.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Custom column - Ability to display icon(s)

Post by bdeshi »

@LittleBig, no problems for me either. Icon columns were a bit buggy until the last beta. Do you have the latest <xyver>?


btw, the last closing brace in the if block should be after the 0, (although actually there's no problem as it is)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Custom column - Ability to display icon(s)

Post by LittleBiG »

SammaySarkar wrote:@LittleBig, no problems for me either. Icon columns were a bit buggy until the last beta. Do you have the latest <xyver>?


btw, the last closing brace in the if block should be after the 0, (although actually there's no problem as it is)
Indeed, thanks!

I managed to reproduce it on a different computer, so I give a detailed instruction:
1. Open a brand new instance
2. Go to a folder containing executables.
3. Right-click on the Ext column and choose Add column. Undefined appears.
4. Right-click on the Undefined column, choose "Select Custom Column" and choose the first Undefined one. (Custom Column 16) Seemingly nothing happens.
5. Right click again on the column header Undefined and choose "Configure Custom Column 16"
6, Fill out the form like this:
2017-03-22_18h03_45.png
2017-03-22_18h03_45.png (11.88 KiB) Viewed 2522 times
7. Click OK.
8 Add a new User button to the address bar. Name "Refresh List", on left click: #485
9. Refresh the list by the new button. Now you should notice what I mentioned earlier, circles appear on the wrong places.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Custom column - Ability to display icon(s)

Post by bdeshi »

Indeed.
LittleBiG wrote:8 Add a new User button to the address bar. Name "Refresh List", on left click: #485
This is the point of concern, Don.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Custom column - Ability to display icon(s)

Post by admin »

Yep, let's see if I can fix it... :twisted:

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

Re: Custom column - Ability to display icon(s)

Post by admin »

Fixed. :cup:

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Custom column - Ability to display icon(s)

Post by SkyFrontier »

While your at it, why not adding draw.star so current official rating system gains script freedom?

...or what about the ultimate capability of a

draw.pixel
with parameters to control h x w position, density perhaps (allowing blank pixels too), round\square\rhombus as base formats, color?

Finally, spreading those draw.* to status (mainly), text(), echo() and other user outputs?

TIA!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Custom column - Ability to display icon(s)

Post by Filehero »

Code: Select all

v17.80.0006 - 2017-03-26 15:41
  +++ List | Size Column: Now the Size column can have graphical representations 
      of the byte counts right in the column. Simply right-click the Size column 
      header and choose between three options:
        - No Graphics     Shows no graphics.
                          Like it has been all the years before.
        - Circles         Shows circles identical to macro >draw.circle.size.
                          Diameter adjusts to row height (which adjusts to font size).
        - Bars            Shows bars identical to macro >draw.bar.size.
                          Width: 50 pixels, Height: small icon height minus 2.
      ......
    + Custom Columns: Added macro ">draw.bar.size". It will draw a column-wide 
      colored size-related bars according to a hard-coded color scheme:
          grey:   Empty
          green:  < 1KB
          yellow: < 1MB
          red:    < 1GB
          purple: 1GB or more
Really nice!! :appl: :appl:

Something for v2.0:
- bars: allow to manually change the colors (or re-assign the coded color set). For me red has a higher warning impact than pink.
- circles (and bars?): allow unique color for files and folders. I would choose grey to have a decent visual size indicator across all file items.

Something for v3.0:
- bars:render the numeric sizes into the bars. :lol:

Very helpful addition!

Cheers,
FH

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

Re: Custom column - Ability to display icon(s)

Post by admin »

Filehero wrote:- bars: allow to manually change the colors (or re-assign the coded color set). For me red has a higher warning impact than pink.
It's not pink, it's infra-red. Rainbow logic. ;)

Anyway, if you don't like my colors then script you own. :P (Okay, not inside the Size column)

PS: Agreed, really nice feature! :biggrin:

And all this goes back to a post by highend from 13 Mar 2017 12:14. :tup: :cup: :appl:

Post Reply