Components / Layout
u:status
A bar of what stands where: start, center and finish are lists of items { key, words, icon, tip, keys, priority, press, tone, width }.
The code
return pencere.div():border(1, "border"):rounded(6):clip():child(u:status("status", {
start = { { key = "branch", words = "main", icon = "dot", priority = 9 } },
center = { { key = "note", words = "Saved notes.md", priority = 1 } },
finish = {
{ key = "pos", words = "Ln 12, Col 4", press = true, priority = 5, tip = "Go to line" },
{ key = "lang", words = "Lua", priority = 3 },
},
}))
What it does
A bar of what stands where: start (before), center and finish (after) are lists of items { key, words, icon, tip, keys, priority, press, tone, width }. An item with press answers the pointer (press { key }) and is a button to a screen reader. Where the page is too narrow for all of them, the items of the least priority (5 unless said; the higher stays) go first, and then, among those, the last of finish, then center, then start; how wide an item is is a guess of its words' length until a page can measure text (an item whose words are an element says its width, points, for the guess to be right).
Its icon
An icon that a component or one of its items takes is an element the page made, a path of the page's own bundle ("icons/save.svg": an SVG or a PNG, tinted in the colour the component draws it in), or the name of one of the library's glyphs: check, chevron_down, chevron_left, chevron_right, chevron_up, close, dash, dot, info, plus, warning.