Page 1 of 1

Custom Sort List

Posted: 07 May 2023 15:41
by avivariba
The Sort By/List is quite bloated for me, with me only ever using 3 of the 28 options that show by default.

It would be really nice if...

1. options could be (un)checked and hidden, perhaps with the unchecked ones only showing in the Sort List under '...' (e.g. being able to uncheck and hide 'F-Stop');

2. a custom order could be given to the list (e.g. moving 'Name' to the top, 'Size' second, etc).

Kind of like Color Filters or List Management alike.

For some unknown reason, 'Extra 16' shows in between 'Extra 5' and 'Extra 6' for me in the Sort List under '...', the order being 'Extra .. 4, 5, 16, 6, 7 ..', which lead me to believe the above is already possible. I am fairly certain I looked everywhere, but I could find no such option.

Re: Custom Sort List

Posted: 07 May 2023 20:21
by highend
I don't think this will happen...

Use scripting to create what you want

Code: Select all

"By name" #321;
"By size" #323;
"By type" #324;
Command ids can be looked up via the Help - List All Commands... menu

Re: Custom Sort List

Posted: 07 May 2023 20:56
by avivariba
highend wrote: 07 May 2023 20:21 I don't think this will happen...

Use scripting to create what you want

Code: Select all

"By name" #321;
"By size" #323;
"By type" #324;
Command ids can be looked up via the Help - List All Commands... menu
I found that for a popupmenu button it's nice. Unfortunately it has no state checkmark by default, and the 'Sort By' in the context menu will still be a bit of a hell.

I suppose the 'Extra 16' being out of place really is just a small bug then.

Re: Custom Sort List

Posted: 07 May 2023 21:06
by highend
Unfortunately it has no state checkmark by default
Even that could be scripted, but not with that simple multiline version

Re: Custom Sort List

Posted: 07 May 2023 21:43
by Norn
Unfortunately it has no state checkmark by default

Code: Select all

get("#333")
get("Sort")
Add icon to popupmenu. :)

Re: Custom Sort List

Posted: 07 May 2023 22:18
by highend
E.g.:

Code: Select all

    $sortBy = gettoken(get("Sort"), 1, ",");
    $menu   = <<<>>>
By name|#321;||
By size|#323;||
By type|#324;||
    >>>;
    $default = regexmatches($menu, "^By " . $sortBy . "\|.+?(?=\r?\n|$)");
    if ($default) { $menu = replace($menu, $default, $default . 3); }
    $sel = popupmenu($menu, 6:=<crlf>, 7:="|");

Re: Custom Sort List

Posted: 07 May 2023 22:42
by avivariba
highend wrote: 07 May 2023 22:18 E.g.:
I was just about to get frustrated trying to script it myself, and then you dropped this surprise. :veryconfused: Thank you!! :biggrin:

To make it look a little more similar to the original (for if that were to help anyone else), I dropped the By (and "^By " . ), and changed the replace with $default . 2. :party: