Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to show all filenames #5

Open
moqmar opened this issue Jun 17, 2018 · 5 comments
Open

Option to show all filenames #5

moqmar opened this issue Jun 17, 2018 · 5 comments

Comments

@moqmar
Copy link

moqmar commented Jun 17, 2018

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.

@occivink
Copy link
Owner

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.

@moqmar
Copy link
Author

moqmar commented Jun 18, 2018

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

@occivink
Copy link
Owner

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.

@moqmar
Copy link
Author

moqmar commented Jun 18, 2018

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. 😆

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.

@occivink
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants