Page 3 of 6

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

Posted: 20 Mar 2017 15:00
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 3540 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. ;)

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

Posted: 20 Mar 2017 15:12
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:

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

Posted: 20 Mar 2017 15:16
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:

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

Posted: 20 Mar 2017 15:18
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... ;)

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

Posted: 20 Mar 2017 15:25
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*/

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

Posted: 20 Mar 2017 15:33
by admin
Wowee, bringing the fun back into computing... :biggrin:

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

Posted: 20 Mar 2017 15:52
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...

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

Posted: 20 Mar 2017 16:33
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. ;)

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

Posted: 20 Mar 2017 16:51
by admin
Still fail to see the flash of red, maybe smoking the wrong stuff. Classified as ghosty glitch for the time being.

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

Posted: 20 Mar 2017 17:12
by admin
Wow, now I saw it in Small Icons view! Gone fixing... :twisted:

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

Posted: 20 Mar 2017 21:05
by TheQwerty
2017-03-20 155948.png
2017-03-20 155948.png (10.92 KiB) Viewed 3504 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.

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

Posted: 20 Mar 2017 21:11
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...

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

Posted: 21 Mar 2017 08:42
by bdeshi
Git status icons!
git-circles.png
git-circles.png (19.26 KiB) Viewed 3468 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.

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

Posted: 21 Mar 2017 08:52
by admin
Wow!!! :shock: :appl:

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

Posted: 21 Mar 2017 09:30
by bdeshi
Hey Don, you might have missed this post before. There's a bug with icon CCsand list/click trigger.