Skip to content

v0.17.2

Choose a tag to compare

@github-actions github-actions released this 15 Oct 00:43
· 287 commits to main since this release
2239ca4

Added

Core

  • FocusOrigin::Restored and EventContext::focus_origin. When a
    rebuild destroys the focused widget, the tree now puts focus back on its
    successor with the Restored origin rather than Programmatic. Like
    Programmatic, it leaves the focus ring as it was. An on_focus(true, …)
    handler can read the origin from EventContext::focus_origin, which is
    None outside a focus gain. FocusOrigin is #[non_exhaustive], so a
    match with a wildcard arm keeps compiling.

Widgets

  • List buttons for a rich-text toolbar: current_list_style,
    set_list_style and toggle_list.
    RichTextEditor and EditorHandle
    could make a list (insert_list) but could not say whether the caret was
    in one, so a toolbar's "Bullets" and "Numbering" buttons could neither show
    as pressed nor take the list away. current_list_style returns the style
    of the caret's list, or None outside one. toggle_list(ordered) is a
    word processor's button press, as one undo step: in a list of that kind
    the paragraph leaves it (with a selection, every selected paragraph does);
    in a list of the other kind the whole list changes kind and keeps its
    depth (with a selection, the selected paragraphs become a new list); and
    outside a list it makes one. set_list_style restyles the caret's whole
    list. rich_text::list_style_is_ordered sorts a ListStyle into the two
    kinds: disc, circle and square are bullets, and the rest are numbered.

Fixed

Widgets

  • A search field that rebuilt itself as the user typed kept only the last
    character.
    In a CommandPalette, or any field whose own value rebuilds
    an ancestor, each keystroke recreated the field. The tree put focus back
    on the new field, the field took that for a keyboard focus and selected all
    of its text, and the next keystroke replaced it. A TextInputField
    (TextInput, SearchField and SpinBox are built on it) now puts the
    caret at the end of its text on a restored focus instead. The previous
    caret position is lost with the destroyed field, so editing in the middle
    of a field that rebuilds this way still moves the caret to the end.

Full Changelog: v0.17.1...v0.17.2