Closed derivmug closed 5 years ago
<CRImier> derivmug: what do you think about moving GridMenu to BaseListBackgroundableUIElement?
<derivmug[m]> Ok, what would I need to change/add
<CRImier> well, it's a ListUIElement
<CRImier> it has menu navigation primitives already in
[...]
<CRImier> as well as useful stuff for working with "contents"
<CRImier> come to think of it, we don't really need to pass a X*Y grid as "contents"
<CRImier> merely rendering it all as a list (and overriding move_up/down/left/right ofc)
<CRImier> should do
<CRImier> like you have with calendar, for example
<CRImier> actually
<CRImier> don't really need to redefine move_up/down/left/right?
<CRImier> oh wait, you do
<CRImier> move_left/right would work as move_up/down currently do
<CRImier> in list UI elements
<CRImier> and move_up/down would skip to next/previous row
Merging #123 into devel will increase coverage by
0.07%
. The diff coverage is34.95%
.
@@ Coverage Diff @@
## devel #123 +/- ##
==========================================
+ Coverage 40.56% 40.64% +0.07%
==========================================
Files 248 251 +3
Lines 19950 20276 +326
==========================================
+ Hits 8093 8241 +148
- Misses 11857 12035 +178
Impacted Files | Coverage Δ | |
---|---|---|
apps/hardware_apps/zp_test/key_test.py | 0% <ø> (ø) |
|
emulator.py | 3.84% <0%> (-0.03%) |
:arrow_down: |
apps/hardware_apps/zp_test/main.py | 0% <0%> (ø) |
|
ui/canvas.py | 86.54% <100%> (+0.08%) |
:arrow_up: |
ui/__init__.py | 100% <100%> (ø) |
:arrow_up: |
ui/tests/test_base_list_ui.py | 75% <100%> (+2.5%) |
:arrow_up: |
ui/base_list_ui.py | 82.1% <100%> (+5.41%) |
:arrow_up: |
apps/example_apps/sandbox/main.py | 40.9% <16.66%> (-22.73%) |
:arrow_down: |
ui/tests/test_grid_menu.py | 32.19% <32.19%> (ø) |
|
apps/example_apps/grid_menu_test/main.py | 60% <60%> (ø) |
|
... and 8 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update bac028e...c4021ba. Read the comment docs.
Hi! Thank you for the work, currently building the main menu from it. Some feedback:
pointer
handling code. So, redefining pointer
to pretty much be x_index
doesn't make a lot of sense and will introduce differences from code that we already have that relies on pointer
to be an index in contents
, and isn't even necessary.GridMenu
that actually ought to be in GridView
because it's only relevant when we display the menu. I.e. we only actually care about y_index
when we draw the menu on the screen.Working further - got an idea in my head of how it all could work, hope you like how it turns out =)
Also, do check how other UI elements work, it doesn't make sense to break conventions - i.e. making contents
into a keyword argument when Menu
, a parent UI element, has it as the first positional argument.
@derivmug thank you!
This branch adds a 3x3 grid menu.