"Filter by name" doesn't toggle?

I was just toying with the "Filter by Name" tool.

I made a button for it on the toolbar and when I click it, it creates a one line interface above the status bar at the bottom. I've noticed two things about its behavior:
1.) When I click the button a second time, it doesn't toggle the line off. Doesn't seem to work like other toggling buttons in DOpus. I can hit Escape to exit it, but would prefer to have escape just clear the text in the filter field rather than toggling the thing off.
2.) When I change focus to another window, it clears the filter and toggles it off. Not sure why this happens? Seems like default behavior would be to leave it alone?

Can I customize this button so that it will toggle with a second click? Can I customize to make DOpus leave it alone when I change focus?

See Preferences / File Displays / FAYT and Filter Bar Options for options to change that kind of thing.

Regarding #1, the button behaving as a toggle, I couldn't find anything in settings to address that. When I went to edit the button, this is what it shows as the command: "Set QUICKFILTER". Would it be possible to use a different command to toggle the bar on / off?

I was able to resolve #2 in the preferences, thank you! I unchecked the "Clear Quick filter automatically when changing folders" box and that resolved the focus issue.

Set QUICKFILTER on its own will open the filter bar and give it focus.

You can use the settings in Preferences to make it close automatically when it loses focus (or only when it loses focus and there's no filter set; up to you).

You don't really need to make a toggle button just to close the filter bar, as it will close automatically. Just click somewhere else. (Unless you configure it to always be visible, but I assume that isn't the case as the button you have is making it appear.)

If the question is really about how to clear the filter on the second press, not just close the filter bar, then that is possible like this:

@if:Set QUICKFILTER
Set QUICKFILTERCLEAR
Set FOCUS=Source
@if:Else
Set QUICKFILTER

(That will act as a toggle as well, FWIW, if you do really want that for some reason.)

1 Like

Beautiful! Yes I want it to clear contents and hide the quick filter bar on the second press of the button.

So last question, and feel free to ignore this, but I noticed that the behavior before would highlighted the button in a darker shade of gray when the quick filter bar was visible. It no longer does that. Is there a way to preserve the dark gray shading when it's visible?

Add @toggle:If Set QUICKFILTER at the start of the command.

1 Like

You're too good to me! Hah! Thank you, Leo-