Page 4 of 6

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

Posted: 21 Mar 2017 09:32
by admin
I saw it and fixed it. :)

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

Posted: 22 Mar 2017 11:12
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
  

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

Posted: 22 Mar 2017 11:47
by LittleBiG
Refresh list messes up the custom column. Refresh column sorts it out.

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

Posted: 22 Mar 2017 11:53
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!

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

Posted: 22 Mar 2017 12:34
by admin
LittleBiG wrote:Refresh list messes up the custom column. Refresh column sorts it out.
Could you post the script?

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

Posted: 22 Mar 2017 12:36
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 ''
}

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

Posted: 22 Mar 2017 12:56
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.

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

Posted: 22 Mar 2017 15:23
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)

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

Posted: 22 Mar 2017 18:10
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 3438 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.

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

Posted: 22 Mar 2017 18:32
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.

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

Posted: 22 Mar 2017 18:45
by admin
Yep, let's see if I can fix it... :twisted:

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

Posted: 22 Mar 2017 18:49
by admin
Fixed. :cup:

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

Posted: 26 Mar 2017 17:51
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!

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

Posted: 27 Mar 2017 20:51
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

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

Posted: 27 Mar 2017 21:03
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: