scarpe-team / scarpe

Scarpe - shoes but running on webview
Other
163 stars 28 forks source link

Shoes Drawables should be under Shoes::Types #451

Open noahgibbs opened 12 months ago

noahgibbs commented 12 months ago

In Shoes3, drawables (e.g. Button and EditLine) were under Shoes::Types. Right now the Shoes namespace in the online docs (https://scarpe-team.github.io/scarpe/Shoes.html) is really hard to navigate. The left bar is packed with drawables and error classes, so it's really hard to understand the structure.

I'm working on fixing the error classes thing (see PR #449), but we should also do what Shoes3 did and move all the drawables into Shoes::Types::Button, Shoes::Types::EditLine, etc. Shoes::Types should be a module in Lacci.

The main place to change this is in all the Shoes::Drawable source files (e.g. lacci/lib/shoes/drawables/button.rb). But we may also need to change it in places where we look up classes by name (e.g. https://github.com/scarpe-team/scarpe/blob/main/lacci/lib/shoes/drawable.rb#L45). I think that code will be fine?. Luckily it's used by nearly everything, so if it's a problem, the tests should catch it.

I think Shoes::Drawable probably should not go into Types, just so it's more visible in the docs as being its own thing. So probably just the stuff in lacci/lib/shoes/drawables.