ZeroPhone / ZPUI

Official ZeroPhone UI framework, based on pyLCI
http://zpui.rtfd.org/
Apache License 2.0
79 stars 19 forks source link

Grid menu #123

Closed derivmug closed 5 years ago

derivmug commented 5 years ago

This branch adds a 3x3 grid menu.

CRImier commented 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
codecov[bot] commented 5 years ago

Codecov Report

Merging #123 into devel will increase coverage by 0.07%. The diff coverage is 34.95%.

Impacted file tree graph

@@            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.

CRImier commented 5 years ago

Hi! Thank you for the work, currently building the main menu from it. Some feedback:

Working further - got an idea in my head of how it all could work, hope you like how it turns out =)

CRImier commented 5 years ago

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.

CRImier commented 5 years ago

@derivmug thank you!