Skip to content

PyUI: Descriptive list view: let views turn off or set the title cap - #1897

Closed
abalakh wants to merge 1 commit into
spruceUI:Developmentfrom
abalakh:descriptive_list_title_cap
Closed

abalakh wants to merge 1 commit into
spruceUI:Developmentfrom
abalakh:descriptive_list_title_cap

Conversation

@abalakh

@abalakh abalakh commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

#1871 cuts list titles at 35 chars (scaled by screen width) and scrolls the selected one. That's fine for Spruce's own lists, but Cheevos already fits its titles to the row in pixels. So a title that fits still loses its last few chars with no ellipsis, and a selected long title scrolls forever, which keeps the idle frames from #1890 from ever starting.

Views can now opt out or pick their own length:
DescriptiveListView takes title_max_chars, and ViewCreator.create_view passes it through as icon_and_desc_title_max_chars.

  • None (default): same cap as now
  • DescriptiveListView.NO_TITLE_CAP: no cutting or scrolling
  • any other number: cap at that many chars

Spruce's own menus don't pass it, so nothing changes for them.

Tested on desktop with Cheevos' awards list: the default still cuts and scrolls, NO_TITLE_CAP shows the full title and the screen goes idle, and 20 cuts at 20.


class DescriptiveListView(ListView):
# For title_max_chars: leave titles whole, e.g. for callers that fit them to the row themselves
NO_TITLE_CAP = 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied approach from NonDescriptiveListView.USE_ICONS_FOR_LINE_HEIGHT_CALC/DONT_USE_ICONS_FOR_LINE_HEIGHT_CALC. Can drop it and just pass 0 if needed

@abalakh

abalakh commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Closing per discussion, let's rather be smarter about it:

I think I'd rather not allow the caller to set this
It shouldn't depended on where it's called from, it should be based on theme and don't choices
It should be dynamically calculated
Also I don't think the caller should be able to opt out, but the user instead in a general sense for that theme

@abalakh abalakh closed this Oct 21, 2026
@abalakh
abalakh deleted the descriptive_list_title_cap branch October 21, 2026 13:55
@abalakh
abalakh restored the descriptive_list_title_cap branch October 21, 2026 17:46
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

Successfully merging this pull request may close these issues.

1 participant