feat(ui): number and key fields, notes, anchored popovers, text-shadow, and pictures as painted
- <input type="number" min max step>: typed digits replace its value (a minus when min allows one, a point when step has a fraction), Enter or leaving the field commits them held between min and max, the left and right arrows step it. - <input type="key">: Enter or a click starts it listening and the next key is its value, Tab, the arrows and Enter included; Esc stops it listening, Backspace clears it, `shown` names the value, and ui_capturing() tells the host to leave its keys alone (through the frame that ended it). - note="..." under any control's label (.ui-labels > .ui-label + .ui-note); a range's (or number's) value with decimals, format="percent" and a unit. - A popover with `anchor="id"` (the nearest element of that id) or a bare `anchor` (the element before it) sits beside it by `placement` (right, left, bottom, top), its margin the gap, opens to the other side where it would leave the screen, and is kept on it. - A tooltip's title splits into lines at a newline or a written \n. - text-shadow, inherited, drawn sharp under the text. - ui_opacity(): the group opacity a native's draw is at. - border-image is drawn as painted with no background colour, tinted by one, and not at all when that colour is transparent (it drew a white nine-slice). - A picture file is drawn untinted, as a browser draws one; an atlas cell (prefix:name) still takes the color around it, and an <img> with its own color is tinted by it. - The render3d backend loads a picture again when its file changes or appears (a failed load was kept for ever), and at once after ui_image_reload(path); takes a path with a drive letter (C:/...) as a path rather than an atlas; and slices a nine-slice by its texture's own width and height. - ui_inputs.ludic and ui_look.ludic; LANGUAGE.md and the changeset say all of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7d8f34de17
commit
9f59000f5b
39 changed files with 732 additions and 75 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# focus.ludic - the keyboard's place: focus moves through the controls in document order (Tab and
|
||||
# Shift+Tab, or the arrows), Enter and Space activate what has it, and a pointer press focuses what
|
||||
# it presses. A key that is gone from the screen leaves nothing focused.
|
||||
# it presses; a key field that is listening has every key to itself. A key that is gone from the screen leaves nothing focused.
|
||||
var fc_key: string = ""
|
||||
var fc_visible: bool = false # focus came from the keyboard: :focus-visible, and the ring
|
||||
var fc_list: []UiNode = new []UiNode
|
||||
|
|
@ -28,8 +28,9 @@ function fc_move(step: int) -> void {
|
|||
function fc_keys(root: UiNode) -> void {
|
||||
fc_list = new []UiNode
|
||||
let top = pp_top(root)
|
||||
if top != null and in_now.escape { ui_fire(top, "close", Value.null()) }
|
||||
if top != null { fc_collect(top) } else { fc_collect(root) }
|
||||
if ct_key_capture(fc_list) { return }
|
||||
if top != null and in_now.escape { ui_fire(top, "close", Value.null()) }
|
||||
let i = in_now
|
||||
if fc_find() < 0 { fc_autofocus() }
|
||||
let at = fc_find()
|
||||
|
|
@ -39,6 +40,7 @@ function fc_keys(root: UiNode) -> void {
|
|||
let horizontal = n != null and ct_takes_arrows(n)
|
||||
if i.up or (i.left and not horizontal) { fc_move(-1) }
|
||||
if i.down_key or (i.right and not horizontal) { fc_move(1) }
|
||||
ct_num_blur(root)
|
||||
if n == null { return }
|
||||
if i.enter or (i.space and not ct_takes_space(n)) { ct_activate(n) }
|
||||
if horizontal and i.left { ct_step(n, -1) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue