adafruit / adafruit/Adafruit_CircuitPython_DisplayIO_Layout

Suggestions based on current status.

Open
#1 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13
Forks
16
PR merge metrics
No merged PRs in 30d

Description

@FoamyGuy @kmatch98 Thank you so much for writing this! It made my project much simpler. Here are a few thoughts!

For context, I am currently working with [this file](https://gist.github.com/FoamyGuy/3d5826ede385554b54175b66c624113a).

The project I am using it in can be found [here](https://github.com/kattni/light_box/blob/main/light_box.py).

In terms of `add_sub_view`:
* The naming of the function `add_sub_view` doesn't make it clear to me what it's doing - the example did that. I do not know, however, from where the name was derived, so it could be a `displayio` thing, in which case proceed as is. Really, I am unclear on what the concept of a `view` is - this may be a concept I'm simply unfamiliar with in which case education will resolve the issue. Otherwise, consider a naming change to make things more clear.
* Along those lines, `view` could be clearer. That or we supplement with excellent documentation. :)
* `view_grid_size` should default to `(1, 1)` as that seems like a sane default. It would significantly shorten up a basic constructor.

In the `GridLayout` constructor:
* `child_padding` could be more clearly named, I had to mess with it to figure out what it did, and I'm still not sure I really know.
* `max_children` could default to the grid size `x` * `y`.
* Looking at it, I'm wondering what `child_padding` does versus what setting `x` and `y` do?

Feature requests:
* I would appreciate a way to nudge or "pad" columns or rows. I did it initially by adding spaces into all of the text elements, then went back and created a grid that included empty columns as padding. Basically I have a column on each side of the display that is only a few characters wide, and the ones in the middle are much wider. So I "padded" it with empty columns. The results were successful, but I'm wondering if there's some way to control subsections of the grid without making everything a lot more complicated. (That last bit is important!)

These are the things that occurred to me while using the version linked above in a project. I'm sure I'll come up with more as we work through it!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.