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

Allow icon to be optional in DetailedList #2342

Open
freakboy3742 opened this issue Jan 15, 2024 · 0 comments
Open

Allow icon to be optional in DetailedList #2342

freakboy3742 opened this issue Jan 15, 2024 · 0 comments
Labels
enhancement New features, or improvements to existing features.

Comments

@freakboy3742
Copy link
Member

What is the problem or limitation you are having?

The layout of items in a DetailedList currently allocates space for an icon, regardless of whether icons are provided. If you have a data source that contains no icons, this leads to a lot of wasted space in the layout.

Describe the solution you'd like

A flag on the constructor for DetailedList which specifies whether the list should attempt to render icons.

Describe alternatives you've considered

The API for this could take a number of forms:

  1. A specific render_icons=True/False flag
  2. Specifying an icon accessor name of None
  3. Specifying an accessor list that only has 2 items, rather than 3.
  4. A flag that is more than a simple True/False, but indicates a rendering "pattern" (i.e., "TitleSubtitleAndIcon", "TitleAndSubtitle"). This would allow adding other rendering patterns in future that might be of use (e.g., rendering the icon at a different size, or in a different place).
  5. A full API for describing the layout of DetailedList items. This is essentially an extension of (4); we'd ship 2 default layouts (for with-icon and iconless title+subtitle layouts), but we'd allow the user to define their own layouts.

2 or 3 would be the easiest to implement solution; 5 would be the most comprehensive (but also the most complex).

Of course, the other option is the obligatory "do nothing", and require that icons are part of the rendering of DetailedList.

Additional context

As part of this, we should also consider how we could introduce multiline text content, especially for the subtitle element. The single-line content constraint (see #2343) is born of the need for every row in the list to have the same height. However, most DetailedList implementations will allow variable height content (e.g., a social media timeline where comments can be multiple lines).

Any API proposal for options 4 and 5 should also include the option of interactive elements on the list - e.g. buttons to "like" a social media post in the body of the post.

@freakboy3742 freakboy3742 added the enhancement New features, or improvements to existing features. label Jan 15, 2024
@freakboy3742 freakboy3742 transferred this issue from beeware/briefcase Jan 16, 2024
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

No branches or pull requests

1 participant