GlenDC / trixel

An easy to use webtool, to make trixel art.
http://www.glendc.com/trixel/
MIT License
18 stars 0 forks source link

Refactor viewing / layout code once most of th ui and functionality is ready #94

Closed GlenDC closed 9 years ago

GlenDC commented 9 years ago

Once we're done with implementing the previously existing features of the editor and its ui, it would be a good idea to study the code base related to rendering and see if we can do better.

GlenDC commented 9 years ago

Part of it would also to centralise some constant UI actions into a record with a minimum amount of information available.

For example: right now we render menu buttons in the following way:

viewSvgButton
      ActionIcons.info_outline
      (viewLabel showLabels "About")
      "General information on Trixel."
      []
      (model.work.state == TrState.About)
      size model TrWork.address
      (TrWorkActions.SetState TrState.About)

The unique properties of such a UI element are:

This is probably the minimum amount of information needed for a button. The record could also be extended for special buttons such as a toggle button that has additional property on top of the previously mentioned properties:

Implementations such as this will help to make the code more modular and cleaner by seperating the definition of UI elements and the actual render code, as it should be.

GlenDC commented 9 years ago

This should also revolve the mess that Graphics.elm now is.

GlenDC commented 9 years ago

UI Problems could be seperated in: