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

Text in table cell rendering on top of adjacent cell #700

Closed
2 of 14 tasks
arichar6 opened this issue May 24, 2019 · 2 comments · Fixed by #2011
Closed
2 of 14 tasks

Text in table cell rendering on top of adjacent cell #700

arichar6 opened this issue May 24, 2019 · 2 comments · Fixed by #2011
Labels
enhancement New features, or improvements to existing features.

Comments

@arichar6
Copy link

Expected Behavior

When a table cell has content longer than the cell width, I expect the text to be "hidden" behind the adjacent column. Preferably there would be an ellipsis character (…) appended to the truncated text to indicate that text is hidden.

Current Behavior

Using the cocoa backend for macOS, the text is rendered on top of the text from the adjacent column.

Screen Shot 2019-05-24 at 4 31 29 PM

Steps to reproduce

  1. git clone most recent toga
  2. cd to the directory for the table_source example
  3. python -m table_source

Your Environment

  • Python Version: 3.6.7

  • Operating System and Version

    • macOS - version: 10.14.4
    • Linux - distro: - version:
    • Windows - version:
    • Other - name: - version:
  • Toga Target (the type of app you are trying to generate)

    • android
    • cocoa
    • django
    • gtk
    • iOS
    • tvOS
    • watchOS
    • winforms
    • win32
    • Other (please specify)
@freakboy3742
Copy link
Member

Thanks for the report! Confirmed that this behavior is reproducible; it appears to be a bug in the cell renderer not clipping content to the box border.

@freakboy3742
Copy link
Member

This has been significantly improved on by #822; however, I think there's room for more improvement.

The new code truncates text at the word boundary, but Cocoa has builtin support for text being truncated at the character level, and auto-inserting an ellipsis (...) when the text has been truncated - it even allows for automated squeezing of the kerning if slightly tighter spacing between characters will let a word fit. These features are part of NSTextField; I presume they're adaptable to NSTextFieldCell, but I can't say I can point to an obvious page of docs that says so.

@freakboy3742 freakboy3742 added enhancement New features, or improvements to existing features. up-for-grabs labels Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants