mpv-gallery-view icon indicating copy to clipboard operation
mpv-gallery-view copied to clipboard

Option to show all filenames

Open moqmar opened this issue 6 years ago • 5 comments

Unfortunately the gallery only shows the filename of the currently selected item, it would be great if there was an option to show all filenames.

moqmar avatar Jun 17 '18 11:06 moqmar

That would be possible, but in case of long filenames it will cause some ugly overlap. There is just no reasonable way in ASS to know the bounding box of some text, so we can't truncate or wrap the text properly.

occivink avatar Jun 17 '18 16:06 occivink

Yeah, I guess the only way would be to count how many "W"s fit with the default font and cut the filename off after that. I guess that ASS thing is the worst thing about mpv... o.O

moqmar avatar Jun 18 '18 07:06 moqmar

Yeah, I guess the only way would be to count how many "W"s fit with the default font and cut the filename off after that.

I'm not really fond of that, the default font is platform-dependent so it'd be pretty brittle. I guess I could let users specify the average width in pixels of a character (and allow up to thumb_width / avg characters), and cross fingers we won't run into edge-cases.

I guess that ASS thing is the worst thing about mpv... o.O

It's pretty nice actually. In case you didn't know, ASS is a (relatively) advanced subtitle format that lets you draw all sorts of geometric primitives (in addition to subtitles of course). The on-screen controller is drawn entirely with it, so it's pretty powerful.

occivink avatar Jun 18 '18 08:06 occivink

It's pretty nice actually. In case you didn't know, ASS is a (relatively) advanced subtitle format that lets you draw all sorts of geometric primitives (in addition to subtitles of course). The on-screen controller is drawn entirely with it, so it's pretty powerful.

I guess the problem is actually trying to build a GUI with a subtitle format then. :laughing:

What about just giving two settings:

show_filenames=yes|selection|no # "selection" would be the same as show_filename=yes currently
truncate_filenames=12 # max characters, "Big Buck Bunny.mp4" would be truncated to "Big Buck Bun…" with that value

Then, show_filename=yes could additionally show the complete filename of the selected item at the very top or bottom of the screen.

moqmar avatar Jun 18 '18 08:06 moqmar

Yes that would be an acceptable solution. I suggested specifying the average character size because then it would handle dynamic thumbnail sizes, but maybe that's too complicated.

occivink avatar Jun 18 '18 12:06 occivink