Git Product home page Git Product logo

interim's People

Contributors

jd557 avatar scala-steward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

scala-steward

interim's Issues

Centered layout

It would be nice to have some way to center a Rect in an area, for example, to center a button on a screen.

I'm not entirely sure how the API could look like, this could either be a new layout or just a feature of Rect.

Windows are not blocking update of components under it

Imagine a situation like this

imagem

Even though the window calls UiContext.registerItem(id, windowArea, passive = true), this only stops the input if the window is defined first, as in:

onTop(window(...))
button(...)

However, it's much more natural to do the opposite:

button(...)
window(...)

While I think it should be possible to address the button click, the hot button is unfixable with the current model (as, by the time the window code runs, the button already decided that it's hot).

One alternative that can be explored is to delay everything by one frame, namely:

  • The UiContext keeps both the hot/active/selected state and a scratch state
  • registerItem updates the scratch state and returns the ItemStatus based on the current state
  • Before the next frame, the UiContext updates the state with the content of the scratch

It's possible that I'm missing some obvious issue with this approach, but I think with this the components would never see invalid intermediate values of InputStatus.

Support clipping

MicroUI has 4 types of operation:

  • MU_COMMAND_TEXT
  • MU_COMMAND_RECT
  • MU_COMMAND_ICON
  • MU_COMMAND_CLIP

InterIm already supports text and rectangle, and I think icons are better served by a custom element.

However, there's still the question of clipping, which is required for smooth scrolling inside a box.

I'm not much of a fan of having this as a RenderOp, as it adds some extra complexity to the interpreter - as some backends might not support this natively and it requires keeping some state.

I think it might be viable to move that state logic to the UIState so that:

  • Rectangles are already clipped (or ignored) when added to the list of render ops
  • Text and Custom ops bring both an area and a clip area
  • The draw char conversion ignores chars outside of the clip area.

I'm not sure if I should also add a clip rect to chars, or if I should just keep it simple... maybe I'll add it anyway and let the backend sort that out.

Sliders click area does not feel right

Something off about the sliders, which is more obvious when there are few options. They seem to be biased towards the lower option.

See the example image. If I press somewhere in the red area, it goes to the first position. There should be a safe space around the center where nothing changes.
imagem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.