Command to toggle quickfilter on/off?

I'm trying to create a command that should toggle the last used quickfilter on/off.

Intentionally I tried this (but obviously the @ifset:QUICKFILTER doesn't work):

@ifset:QUICKFILTER
Set QUICKFILTERCLEAR
@ifset:else
Set QUICKFILTER=!prev

If there any other way to conditionally clear or set the quickfilter according to the current state?

This will toggle the effect of the filter:

Set QUICKFILTERFLAGS=disable

You can do the same by clicking the filter icon on the left of where you type the filter pattern, too.

Yes, but in this case the panel background stays lighred (which is the color for filtered displays on our systems). That was the reason why I tried to achieve an if-then-else condition allowing to actually clearing the filter to reset the background color.

The color being active when the filter is disabled is an oversight on our part. We'll fix that.

I give that a try and unfortunately just disabling the flags does not work well for toggling because sometimes the pattern may be cleared (e.g. by closing the filterbar with mouse or simply some other commands programmatically clearing the filter). Thus the !prev argument seens to be much more reliable. Is there any way to build an if-clause that tests whether a filter is set or not?

It seems that @ifset:QUICKFILTER is always evaluated to false even if a filter pattern is set. If this could be improved the toggle command would work more reliable under several conditions. :smiley:

I also figured that Select NOPATTERN HIDEUNSEL even does not indicate that there are hidden items by changing the background color. I assume that's because this isn't actual filtering?

The color issue has been fixed for the next update.

This actually works fine for me:

@ifset:QUICKFILTER=moo Set QUICKFILTER=cow @ifset:else Set QUICKFILTER=moo

Make sure the keyboard focus is not in the filter bar when you click the button, else the bar will not close.

Ah ok, I have another try to find out if !prev can be used as pattern for the @ifset.

I tried this, but it doesn't toggle the filter.

@ifset:QUICKFILTER=!prev
Set QUICKFILTERCLEAR 
@ifset:else
Set QUICKFILTER=!prev

Since in our configuration the quickfilter is occassionally cleared I'm trying to find an @ifset clause allowing to use !prev and QUICKFILTERCLEAR commands. Unfortunately disabling all flags seems to to work reliable here.

Sorry, I posted the wrong code in my previous reply.

This, the code from your first post, works fine here (provided the quickfilter does not have the keyboard focus, which prevents it from closing):

@ifset:QUICKFILTER Set QUICKFILTERCLEAR @ifset:else Set QUICKFILTER=!prev

That toggles the filter on and off.

Strange, this command ativates but does not clears the filter.

Maybe it depends on my configuration?




Yeah, that's why. "Set QUICKFILTER" on its own will show the filter bar, so @ifset:QUICKFILTER is really testing whether the bar is visible or not, not whether a filter is defined. With the middle options, those two states are the same, unless the filter is actively being edited.

Ok I understand. All in our team are used to work with the FAYT filter-bar instead of the more complex quickfilter bar. Thus unfortunately enabling the more complex quickfilter is not an option.

If @ifset:QUICKFILTER=moo works fine can you make @ifset:QUICKFILTER=!prev working as well?

Or maybe if that looks too esoteric maybe @ifset:!QUICKFILTER would be better? But probably this is only the negation of the other. :open_mouth:

What's complex about the filter bar? It's just a nicer UI to replace that aspect of the FAYT field, with some indicators that help you see how many items are filtered in/out.

Maybe it can be improved by configuration but the feedback in our team was that most people don't like the filterbar because it doesn't show the results incrementally. On the other hand the FAYT field does so, thus we switched over to FAYT.

Example:

Assuming you have the following files:

text-1.txt
text-2.txt
document-1.doc
document-2.doc

Now you start typing: *.doc

If you reach *.d when using the filterbar leads to an empty lister but when using the FAYT you can see how the result set is reduced in realtime. The latter is much more intuitive. Certainly you can type .d but this isn't really applicable.

Preferences / File Displays / Filter Bar / Partial matching
Preferences / File Displays / Filter Bar / Real-time filtering

I already tried these settings but then you have to omit the wildcard (e.g. simply typing doc) what would lead to false positives since the pattern is applied to the name as well. If you want to suppress these false positives you have to explicitely enter the wildcard and this in turn leads to the same empty result list during typing.

Woa, I can disable "Automatically type * when activating the filter bar" which provides exactly the same behaviour as in the FAYT field. Haven't seen that option so far. Thanks for committing to this considerations. :thumbsup:

I think there's a minor conflict between Listary and the Quickfilter bar.

Normally Listary works great to supplement DOpus' FAYT behavior, but when using my filter bar, it seems to prevent the Quickfilter from taking focus.

I'm using Leo's code to launch my Quickfilter:

@ifset:QUICKFILTER Set QUICKFILTERCLEAR @ifset:else Set QUICKFILTER=!prev

I've also setup CTRL + . (ie, ">") as my Quickfilter shortcut. Is there a way the quickfilter code could be modified above to force focus to go to the input box on the Quickfilter bar?

Note that even when I exit Listary and use the button code above, focus goes to the "Find" line rather than to the Quickfilter input box.

If you give Set QUICKFILTER=... a filter to set, it just sets that as the filter and does not change the focus. (If it looks like Find As You Type was given the focus, that's only because it has the focus by default.)

Running Set QUICKFILTER on its own will give the filter bar the focus.

If you want both, you can do both:

@ifset:QUICKFILTER Set QUICKFILTERCLEAR @ifset:else Set QUICKFILTER=!prev Set QUICKFILTER