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

Truncate displayed ship names to prevent overflowing containers #2631

Merged
merged 4 commits into from
Jun 16, 2017

Commits on Jun 14, 2017

  1. Apply truncation to the front of ship names if selling more than one

    Avoids awkward-looking line wraps caused by long ship names when coupled with list-style confirmation dialog.
    Refs endless-sky#2249
    tehhowch committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    561b8ad View commit details
    Browse the repository at this point in the history
  2. Extend truncation to other appearances of ship names

    Adds front or end truncation to the following locations:
     - Hailing screen: no overflow off right edge for combinations of long ship names and/or long government names.
     - Targeting reticle: no overflow off left edge of ship name
     - Ship detail screen: no overlap of "ship:" and the ship name
     - Shipyard/Outfitter ship details screen: no/minimal overflow out of rounded square border
     - Player Info fleet list: no overflow of ship name across category
    
    Front truncation used where possible, to preserve possible identifying numbers on the tail of the ship name, e.g. the "1" in 'My Ship 1'
    tehhowch committed Jun 14, 2017
    Configuration menu
    Copy the full SHA
    1624b16 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0883ac8 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2017

  1. Font::TruncateMiddle

    Allow truncation of strings from the middle out. No special handling to cut in "pretty" locations to do things such as prefer whole-word removal, 2nd-letter starting, etc.
    Changes in border characters from "..." to alphanumerics, plus the slightly reduced width precision of TruncateMiddle vs Truncate(Front) made adjusting some targeted widths necessary.
    tehhowch committed Jun 15, 2017
    Configuration menu
    Copy the full SHA
    00bc200 View commit details
    Browse the repository at this point in the history