Repository navigation
v0.17.2
Added
Core
FocusOrigin::RestoredandEventContext::focus_origin. When a
rebuild destroys the focused widget, the tree now puts focus back on its
successor with theRestoredorigin rather thanProgrammatic. Like
Programmatic, it leaves the focus ring as it was. Anon_focus(true, …)
handler can read the origin fromEventContext::focus_origin, which is
Noneoutside a focus gain.FocusOriginis#[non_exhaustive], so a
match with a wildcard arm keeps compiling.
Widgets
- List buttons for a rich-text toolbar:
current_list_style,
set_list_styleandtoggle_list.RichTextEditorandEditorHandle
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_stylereturns the style
of the caret's list, orNoneoutside 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_stylerestyles the caret's whole
list.rich_text::list_style_is_orderedsorts aListStyleinto 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 aCommandPalette, 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. ATextInputField
(TextInput,SearchFieldandSpinBoxare 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