geom3trik / tuix

Cross-platform GUI toolkit written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Widget Layers

WeirdConstructor opened this issue · comments

I need the ability to redraw only certain widgets. So that the rest of the UI does neither have to be re-layouted or be redrawn. Only the on_draw routine of the widgets in the layer would be called then.

Having a manual way to assign the layers would be fine for now. But I would also be fine with some semi automatic layer mechanism that suffices the following use cases.

A few use cases:

  • Live signal view, where the parent widget draws the background lines, and a child widget (which is in a separate layer) is drawing the signal graph. Then the layer with the signal graph widgets get a redraw each frame to update the signal (which is read out from eg. a ring buffer).
  • Blinking LEDs in a custom hex tile map. The hex tile map widget is drawing everything itself, like the tiles, their text. But there are parts that need to be redrawn each frame for the LED signals. Those would become a child widget of the tile map to draw these LEDs as overlay.
  • Redrawing the pattern editor is more or less expensive, as there is lots of single text elements in it. It would be awesome to have more control over when it is really redrawn and when not. I could put it into it's own layer, which is additionally redrawn when the widget is interacted with.