Skip to main content
Widgets and themes

Widgets and themes

· 2 min read
Balaur

Lists, trees, tables and a code editor are widget kinds. A theme carries roles and hover states, and taffy lays out the whole tree before a pixel is drawn.

  • list holds rows and reports the pick; with columns above one the rows flow into a grid of cards. tree nests them, one leading tab a level, and table splits a row into one cell a column. Only the rows on screen are built.

    A card grid, an outline and a table, all one component

  • code is the file being edited, with its gutter, colours and caret, as a node.

  • In a theme, [colors] names the fills, [<kind>] dresses a kind, and [roles.<name>] is a look a widget takes by name. [<kind>.hover] and [<kind>.active] say how it looks under the pointer.

  • grow, gap, padding, align, justify and the minimum sizes are taffy's flexbox. The tree is solved before drawing, and ui::widget_rect reads back this frame's rect.

  • The editor's shell, docks, tab rows, top bar, outliner and inspector are widget nodes in editor/scenes/main.toml. The timeline, the weight table and two painting tools are draw nodes.

[nodes.widget]
kind = "list"
columns = 5
row_height = 84
grow = 1

examples/interface is a screen of widget nodes; its one script fills three views and writes no layout. The manual and the generated component reference have the keys.