Auto Resize Lister, but vertically?

I made button to Set the lister size to 'Auto', however as the documentation says, it does it for the horizontal axis, but not vertical. I was wondering if a vertical resize could be done where it extends the folder height to the length of the last row/file in the folder.

So if there was a lister with 10 files/rows, it would extend the lister's height to the end of the last row.

I don't think there's a built-in way to do that currently.

You could do it via scripting, at least if you aren't using grouping and your toolbars don't change: A script could be configured with the height of a single-line window and then how much to add for each additional line, and resize the lister that way based on the number of files. The method is a bit crude but should work for most cases. Grouping would make it harder, as group headers are a different height to normal lines, but could be handled with some additional logic.

I see, sorta on that topic, is there a way to auto-resize the image viewer to the dimensions of the current photo that is opened inside of it? Thanks .

If you choose this, it will do that automatically:

Preferences / Viewer / Appearance / Auto-size viewer window: To fit every picture

Ah, right. I can probably make a button to toggle the different behavior options, right? I'd like to be able to sometimes resize the viewer to the boundaries of a picture, but not always. So it's more of a button-thing. (Similar to the aforementioned lister thing)

I don't think there's a command to toggle that setting. It's only available through the Preferences UI.