Custom column - Ability to display icon(s)

Features wanted...
TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

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

Post by TheQwerty »

Very cool idea Don! :appl:

However, my first experiments with this circle ability is off to a strange start.
2017-03-20 095435.png
2017-03-20 095435.png (42.09 KiB) Viewed 2566 times
  1. The List Browse text color is set to FF0000 but the default circle color is blue?
  2. 00FF00 should be green.
  3. Occasionally, after OKing the Configure Custom Column dialog, the column header text changes color. (Mouse hover reverts it back.)
  4. It does not take into account any applied Color Filters. (I realize they are disabled in the screen shot.)
    This is technically okay but if it is to be the case then I'd like to see a way to retrieve information about the CFs currently applied to an item so I can make complementary art. ;)

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

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

Post by admin »

TheQwerty wrote:The List Browse text color is set to FF0000 but the default circle color is blue?
Yes, that's why in the definition it says:

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

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

Post by TheQwerty »

admin wrote:
TheQwerty wrote:The List Browse text color is set to FF0000 but the default circle color is blue?
Yes, that's why in the definition it says:
Huh?

The text color is set to FF0000 therefore the default circle color is 0000FF ??
:veryconfused:

EDIT: And setting the text color to 0000FF makes the default circle color FF0000. :whistle:

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

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

Post by admin »

TheQwerty wrote:00FF00 should be green.
Indeed, it's yellow here too. :veryconfused: Time for a coffee... :cup:
TheQwerty wrote:Occasionally, after OKing the Configure Custom Column dialog, the column header text changes color. (Mouse hover reverts it back.)
Not here so far. Hm.
TheQwerty wrote:It does not take into account any applied Color Filters. (I realize they are disabled in the screen shot.)
This is technically okay but if it is to be the case then I'd like to see a way to retrieve information about the CFs currently applied to an item so I can make complementary art. ;)[/list]
Hmm, let's first take care of the other points... ;)

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

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

Post by TheQwerty »

5) Might be nice if <crlf> could be used as an alternative separator to ';' so that we can more easily define multiple circles with a HEREDOC.


Fun tip: Make your column return a permanent variable and then you can easily play with drawing circles from the address bar.

Code: Select all

return ">draw.circle $P_CIRCLE";
In address bar:

Code: Select all

perm $P_CIRCLE = '12,FF0000'; #485; /*Refresh List*/

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

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

Post by admin »

Wowee, bringing the fun back into computing... :biggrin:

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 »

The next step is to allow this >draw command in other place where icons can be defined: ctb, cfi, tab icons, catalog icons...
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

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

Post by TheQwerty »

v17.70.0208 takes care of 1 (default color), 2 (yellow), and 5 (crlf). :appl:

Recapping:
3) Now I occasionally can see a flash of red and then it restores the correct color.
Note that it is actually flashing the default text color (which I temporarily made red for debugging purposes) so it might not be easily noticed in typical configurations.

4) Color Filter adoption; relegated to wish status.

No new issues found... yet. ;)

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

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

Post by admin »

Still fail to see the flash of red, maybe smoking the wrong stuff. Classified as ghosty glitch for the time being.

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

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

Post by admin »

Wow, now I saw it in Small Icons view! Gone fixing... :twisted:

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

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

Post by TheQwerty »

2017-03-20 155948.png
2017-03-20 155948.png (10.92 KiB) Viewed 2530 times
I know this screenshot says otherwise, but we really need 'draw.oval' with the ability to specify height AND width.

It would beat asking XY to draw 100 overlapping circles for every item and should look quite a bit smoother.

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

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

Post by admin »

LOL. :tup: :biggrin:

I should have known that you come up with something like this. Yes, yes, I called the thing draw.circle because it was clear that draw.* would follow...

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 »

Git status icons!
git-circles.png
git-circles.png (19.26 KiB) Viewed 2494 times
[/size]

Code: Select all

// git-circles: a CC script that shows git status of <cc_item> as colored circles
  $git = "git.exe";
  // status colors as RRGGBB
  $committed = "2ECC71";
  $modified  = "E67E22";
  $staged    = "3498D8";
  $stagemod  = "B56ED2";
  $conflicts = "C0392B";
  $ignored   = "BDC3C7";
  $untracked = "FEEB51";

  $pre = ""; $post = "";
  if (exists("<cc_item>\.git") == 2) {  // when <cc_item> is a root repo folder
    $pre  = " --work-tree=""<cc_item>"" --git-dir=""<cc_item>\.git"" ";
  } else {
    $post = " --ignored ""<cc_item>"" ";
  }
  $ret = substr(runret($git . $pre . " status -s --porcelain " . $post),, 2);
  end ($ret == "fa");  // fatal: Not a git repository [...]
  if     ($ret == "")                       { $status = $committed; }
  elseif (exists("<cc_item>\.git") == 2)    { $status = $modified;  }
  elseif ($ret == "!!")                     { $status = $ignored;   }
  elseif ($ret == "??")                     { $status = $untracked; }
  elseif (regexreplace($ret,'D|A|U') == "") { $status = $conflicts; }
  elseif (substr($ret,, 1) LikeI '[MARC]')  { $status = $staged;    }
  if     (substr($ret, 1, 1) == 'M')        { $status = ($status==$staged)?$stagemod:$modified; }
  if isset($status) { return ">draw.circle 10, 000000, 127; 8, $status"; }

/* Associated custom column snippet. Update path to git-circles.xys if necessary.
Snip: CustomColumn 1
  XYplorer 17.70.0208, 3/21/2017 1:38:42 PM
Action
  ConfigureColumn
Caption
  git
Type
  3
Definition
  load "<xyscripts>\cc\git-circles.xys"
Format
  7
Trigger
  0
Item Type
  2
Item Filter
 
*/

/* https://git-scm.com/docs/git-status#_short_format
XY PATH1[ -> PATH2]

X          Y     Meaning
-------------------------------------------------
          [MD]   not updated
M        [ MD]   updated in index
A        [ MD]   added to index
D         [ M]   deleted from index
R        [ MD]   renamed in index
C        [ MD]   copied in index
[MARC]           index and work tree matches
[ MARC]     M    work tree changed since index
[ MARC]     D    deleted in work tree
-------------------------------------------------
D           D    unmerged, both deleted
A           U    unmerged, added by us
U           D    unmerged, deleted by them
U           A    unmerged, added by them
D           U    unmerged, deleted by us
A           A    unmerged, both added
U           U    unmerged, both modified
-------------------------------------------------
?           ?    untracked
!           !    ignored
-------------------------------------------------
*/
[/size]The detector if-elseif blocks weren't "professionally" tested. Conflict status not tested.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

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

Post by admin »

Wow!!! :shock: :appl:

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 »

Hey Don, you might have missed this post before. There's a bug with icon CCsand list/click trigger.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply