phileday / whirligig-old-issues

Whirligig Media Player bug tracking
0 stars 0 forks source link

Bug: Long file names cut off in file browser and playlist #55

Open cheater opened 4 years ago

cheater commented 4 years ago

Long file names get cut off in both the file browser and playlist. The names should be wrapped around to show multiple lines. Subsequent lines should be indented by a little. Also make sure that when the file is highlighted, it will have a highlight color around it, so make sure that is addressed as well. Also the currently playing file changes font color, so make sure that happens for all lines also.

cheater commented 4 years ago

this has been partly fixed, but now the file names are just too small because the font gets smaller the longer the file name is. instead, the file should just take up more space vertically on the lists.

cheater commented 4 years ago

checked 4.812. There are a few issues:

  1. using GetTextElementEnumerator, iterate over the full file name, and after every character you iterate over, add the soft hyphen character (\u00ad). Reason:

    • don't iterate using foreach (char c in filename) because that will not iterate over full UTF characters, it only ever iterates over two bytes, and UTF characters can be more than 2 bytes.
    • use \u00ad. This is a character which normally doesn't show up at all, it just means that the line may break there, and at the end of the line it will show a small hyphen. here's a demo: https://en.wikipedia.org/wiki/Soft_hyphen
    • this needs to be done because currently the file names will only break on spaces, but they need to break even if the file is only made up of alphabetic characters.
  2. currently files will only take up to two lines. this is bad, because if the file name needs more space the font becomes smaller again. The file names should get as many lines as they need - not just one or two. Make sure this works with max length file names.

  3. those changes have not been applied to the playlist view. they should be applied there as well.