-
v0.5.0
Stablereleased this
2026-11-13 02:15:41 +01:00 | 0 commits to main since this release0.5 is for two kinds of app forma came close to but did not reach: a code
editor or an IDE, and a game engine's editor with a game's UI.For a code editor: what a language server says, shown - positions as it counts
them, hovers on words and completion for code (ADR
0119, and "Language features" in the guide's
text chapter) - and links under the primary modifier, to go to a definition. Editor
tabs that mark changes and ask before they close, a text area's state kept while
its tab is hidden (ADR 0120), highlighting
in slices, a terminal, indent guides, rulers, whitespace shown and tab stops. The
Editor page of the gallery shows them, in Code, and the newideexample,
crates/forma-winit/examples/ide, with rust-analyzer.For a game engine: the GPU inside
run, for a scene drawn into a texture the UI
shows (ADR 0123, and forma-winit'sviewport
example); keys by their place on the keyboard, held keys and the pointer locked to
a widget (ADR 0124); an inspector's rows in
PropertyGrid;TileGrid, for an asset browser; focus by direction, for a pad;
an app's own scale; and a game's look from styles. forma-winit without its default
features brings no desktop crate, for a game's own loop.0.5.0 also has the fixes that were to be 0.4.2, from a review of 0.4.1, among
them a security fix to forma-android's autofill (Security, below). Every app
using forma-android's autofill should update. An app copies no file of the
Android template again.Most of it is additive. What breaks: keys carry a
codeandEvent::Droppedan
at,DockEventis no longerCopy,DockPanelhas more fields, andFindBar
handles the keyboard differently (Changed, below). The migration
guide shows each, with the code before and after.Security
- forma-android: an autofill unlock could give another app's logins away.
At an unlock the system hands the screen's structure to the app being filled.
A malicious app could name a bank in it and, after the user's fingerprint,
get the bank's login: the handler's checks of the package and its signatures
saw the bank's. They are now taken from the fill request, and an unlock
without them is refused. This was read from the code and Android's source,
not run as an attack. - forma-app:
FillRequest::logincould pair a page's user name with a
password field in another site's frame. It now takes only fields of the
focused field's origin, or of the screen's without focus. A form split over
two origins fills less; a handler that wants more names the fields itself. - forma-android: a focused native field beside a web view no longer takes the
web view's page asFillRequest::web. - forma-android: a dataset is no longer filtered by a password's value, which
an app could have probed by typing. - forma-android: the device key's bytes are wiped when an autofill request fails
early, and the arrays sent to Java after an exception. Hiding the keyboard
clears the helper's copy of the field's text. - forma-android: a secure screen draws nothing until
FLAG_SECUREis set, which
happens on Android's UI thread: its first frame could come before it.
forma-ui
Changed
-
Highlightercolors five more TextMate scopes by their kind:support.classand
entity.other.inherited-classas types,variable.functionas a function,
variable.languageas a keyword andentity.name.constantas a constant. Java's types
where they are used, its method calls andthiswere in the text's or the variables'
color. Other grammars change with it: Rust's and Python'sself, JavaScript'sthisand
its calls and built-in classes, C's#definenames. -
A key says where it is on the keyboard, whatever the layout:
InputEvent::Keyhas
code: Option<KeyCode>(ADR 0124). Code that makes
InputEvent::Keyaddscode(Noneif the platform does not say); forma-winit's
runandWinitInputfill it in.// 0.4 InputEvent::Key { key, pressed: true, repeat: false } // 0.5 InputEvent::Key { key, code: None, pressed: true, repeat: false } -
DockEventis no longerCopy:CloseRequestedholds a list of panels. With tabs
that can close, offer events withDockArea::handle_all: an entry of a tab's menu
closes several, each reported, andDockArea::handlereturns one. -
DockPanelhas more fields, for editor tabs (Added, below). Code that writes one
out with its three fields makes it withDockPanel::newand its methods instead. -
FindBartakes the keyboard when it opens, and gives it back to its text area,
on the current match, when it closes.FindBar::revealleaves the keyboard in
the bar, where it used to move it to the text, so that the next key went into
the code. It is reworked to one fixed width, its fields alike, with which match it
is on and the case and whole-word options over the end of the query field, and
icons for the rest, each named in its tooltip;FindRows::match_caseandwhole_wordreport
Event::Clicked, notEvent::Toggled. Its fields claim Enter and Escape, and its
card no longer does: Enter in the text area is a new line while the bar is open,
and Escape closes the bar with the query selected. -
A drop says where it was let go:
Event::Droppedhasat, from the target's top-left
in physical pixels, or in the window with no target. Code that matches it without
..adds..; code that makes it addsat.// 0.4 Event::Dropped { source, target } => ... // 0.5 Event::Dropped { source, target, .. } => ... -
Folding by indentation counts a tab as wide as the text area draws it, to the next
stop: 8 columns unlessStyle::tab_widthsays, where it counted 4 (or the edit
profile's spaces) and added them whatever came before. Code indented with tabs and
spaces both may fold elsewhere.DiffViewershows a tab to the next stop rather than
as four spaces.
Fixed
- Two letters typed in one frame open a
CodeCompletionas typing does, and a trigger
typed with the letters after it opens it after the trigger with them as the query.
Neither opened anything until the next key, as only one character's growth counted as
typing. A paste, an undo or the app's own change, of one character too, opens nothing. - Folds carried to another text area by
Ui::put_text_statehide their lines again there.
They were still folds, infolded_linesand the gutter, but their lines were laid out and
drawn, as the lines worked out from them were kept for the area they came from. - A Ctrl+click on a link in a text area that did not have the keyboard left it with the last
field's caret, and bracket matching then panicked on a caret past its text. A press that
gives a text area the keyboard gives it its own carets first, those it had or one at the
press; bracket matching holds the caret to the text. - A
Dialog's answers that do not fit its card go on to another line, at its right. They
ran out past its left edge, over what is beneath. - A text area's text scrolled sideways goes under its gutter, where it was drawn over the
line numbers. - The cursor is a pointer over a text area's fold mark, as it can be clicked.
- A chooser's and a code completion's rows stay on one line: a long title or
detail wrapped and ran into the next row. The detail gives way before the title. - A progress bar updated more often than its ease lasts (a timer, a playback
position) keeps up with its value: an ease takes no longer than since the fill last
moved. Each one took the whole time again, so the fill lagged behind and never rested. MarkdownEditor: dragging the divider between the text and the preview did
nothing without the app rebuilding, which nothing told it to do. The panes now
resize at once.- A theme file with a text size or a line height of 0, which then panicked in
layout, is an error (ThemeError::BadSize), as are negative ones, and metrics
that are not numbers. - Such a size set any other way (
Style::font_size(0.0)) draws nothing. - Folds that partly overlap no longer hang the UI thread on a caret move.
- Backspace in leading whitespace with
Indent::Spaces(0)no longer panics. DockArea::newtakes a layout read back from a file as it can: empty groups
go, and a tab or ratio out of range is brought into it. A tab's click no
longer panics on one.- A spring with no damping ends after a minute, and a target that is not a
number moves at once: both kept the UI asking for frames for ever.
Added
-
TabBarandDockArea: too many tabs scroll sideways rather than being cut
off or squeezed, by the wheel or a finger, with no scrollbar. The tab that
comes to be active is brought into view. A tab held near an end of aTabBar
moves the strip, and on a strip that overflows a finger scrolls rather than
drags a tab. A strip now clips its tabs, so a tab's focus ring no longer shows
below it. -
ThemeError::BadSize. -
Icons drawn as layers, for badges in a corner of an icon:
Ui::icon_layerswith
IconLayer::drawandIconLayer::cut, which erases what the layers before it drew so
the row, the selection or the tab behind shows through, hover included
(ADR 0128).Icon::cutis the cut as an icon of
its own, drawn in a PDF too.DockPanel::with_iconputs such an icon before a tab's title. -
A
Chooserthat leaves the search to the app picks out the letters typed in each title
too, by forma's matching, for the eye only: nothing is left out or moved.
ChooserItem::matched(chars)picks out what the app's own search matched instead. -
Ui::typed_range(id): what the user just typed into a text input, ending at its caret,
as against a paste, an undo or the app's change.CodeCompletion::set_triggers, for a
language server's triggers known only once it has started. -
Style::read_only(): a text input the user can read, select in, copy from and search but
not change. Each edit tried reportsEvent::EditRefused; a find bar over it offers no
replacing, and a screen reader hears it is read-only.Ui::is_read_only(id). -
The middle button on a
DockArea's tab closes it, as its close button does:Closed, or
CloseRequestedfor a panel that asks.Style::clicks_any_button()makes a clickable
panel report middle, back and forward clicks asClickedwith the button, as buttons
do; without it a panel still reports none, as a handler that does not look at the
button would take a middle click for a click. -
Links under the primary modifier in a text area, for going to a definition
(ADR 0127):Style::text_links,
Event::TextLinkHovered,TextLinkHoverEndedandTextLinkPressed, and
Ui::set_link_range. Theideexample goes to a definition with rust-analyzer. -
Popover::with_max_height, a body that scrolls past a height, and
Popover::open_unfocused, which leaves the keyboard where it was: a hover beside a text
area, read to its end. -
MarkdownStyle::compact()andMarkdownStyle::padding, for Markdown in a small card;
CodeItem::documentation_markdownandCodeCompletion::set_documentation_markdown
(markdownfeature). Theideexample asks rust-analyzer for Markdown and shows its
hovers and documentation so, whole, where it cut a hover at 24 lines. -
Ui::visible_lines(id): the lines of a text area in view, to ask a language server only
about those. -
Style::indent_guides,Style::ruler(column)andStyle::show_whitespace(with
ShowWhitespace): a code editor's indent guides, rulers and spaces and tabs marked, at
the area's tab stops. Theideexample's editor shows the guides. -
LogViewer::with_frame(false): a log without its border and rounded corners, beside an
editor that has none. -
A
SplitButtontakes the variant of the style it is given, both parts filled, outlined
or bare alike, a line parting a fill. APrimaryone is a panel's main action. -
Style::tab_width: a tab stop every so many spaces, 8 without it. The caret, the
selection, clicks and folding follow; columns counted in characters do not change.
StylePatch::tab_widthsets it for every text area of a theme ("text_area": { "tab_width": 4 }in a theme file), andLogViewer::with_tab_widthand
DiffViewer::with_tab_widthfor theirs (8 and 4 without it). -
TextStatecarries a text area's shaped lines, so a tab of 9,000 lines comes back in
0.5 ms rather than 140 ms. They take about 16 KB a line:TextState::shaped_linescounts
them andTextState::drop_shaped_lineslets them go, for an app with many large files
open (ADR 0120). -
Highlighter::update_within: whatupdatedoes, a slice a frame, as a whole file on
the UI thread is most of a second at 10,000 lines.updateof a text moved to another
area withUi::put_text_stateno longer highlights it again. -
Style::match_brackets: the bracket beside the caret marked, with its pair. -
For editor tabs, on
DockPanel:modified,subtitle,tooltip,previewand
confirm_close, withDockLayout::panel,panel_mut,open_previewand
keep_preview.DockEvent::CloseRequestedandDockArea::close, for a tab that asks
before it closes. A tab's menu closes the others of its group, those to its right, or
all, and is there with floating off too.Phrase::ModifiedTab,CloseOthers,
CloseToTheRightandCloseAll. -
terminal::Terminal, withShellOptions,TerminalEventandTerminalParts, behind
theterminalfeature, on the desktop: a shell in a widget, onalacritty_terminal
(ADR 0121).WidgetInput::Key: a focused custom widget
hears a key before the keymap and the shortcuts, going down and coming up
(pressed,repeat, andcodeasInputEvent::Keyhas it).LayoutCx::text_in:
italic text. -
Style::gutter_backgroundandStyle::gutter_separator: a gutter set apart from the
text.Style::no_focus_ring: for a widget that shows the focus itself. -
Terminalshows all a program wrote before it ended, draws a scroll bar and reports the
mouse to a program that asks (ADR 0122).
ShellOptions::env_clear: a program with only the environment you give it.
WidgetInput::OtherButton: the right and middle buttons, for a custom widget. -
Style::wheel_zoomsandEvent::WheelZoom: Ctrl and the wheel over a widget reported
rather than scrolling, for a text the user chooses the size of. A text area whose
font_sizechanges keeps the same line at the top, andTextStatecarries that over a
change of size while its tab was hidden. -
TreeView::with_drop_on_rows: a drop anywhere on a row is into it, for nodes whose
order is not the user's to choose. -
FindBar::over: a find bar in the corner of its text area, going with it, a
press in the text leaving it open, its replacement folded away (set_replacing,
focus_replacement).focus_queryandsearch_selectionfor asking again. -
Placement::inside: a popup within its anchor, along one side. -
Ui::show_text_range: bring a range of a text area into view, the keyboard
staying where it is. -
ChooserItem::icon_coloranddetail_rich, andCodeItem's: an icon in a color
and a detail in its own colors.Chooser::with_search_by_appand
set_empty_text, for a search the app does itself. -
DockLayout::dock_sizedandset_title. -
Ui::offset_at_positionandUi::position_at_offset, withTextPositionand
PositionEncoding: a place in a text in UTF-8, UTF-16 or UTF-32. -
Style::text_hover,Event::TextHovered,Event::TextHoverEndedand
Ui::set_text_hover_delay: the word the pointer rests on in a text area.
Command::ShowHover, on Ctrl+Shift+Space, reports the word at the caret. -
Ui::range_rects: where a range of a text is drawn.Popover::set_rectand
Popover::with_rectplace a popover beside a rectangle. -
widgets::CodeCompletion, withCodeItem,CodeCompletionEvent,
CodeCompletionParts,CompletionReasonandRanking.Command::Complete, on
Ctrl+Space, opens it. -
Ui::take_text_stateandUi::put_text_state, withTextState: a text area's
undo history, folds, carets and scroll, kept while a tab is not shown and carried
to another group or window (ADR 0120). -
KeyCode: where a key is on the keyboard, W3C's names. A release reaches the custom
widget that heard the key go down, wherever focus is, and the window losing focus
lets go of every key held.WidgetInput::PointerEnteredandPointerLeft: the
pointer came onto a custom widget and went off it.Harness::key_downandkey_up
hold a key and let it go (ADR 0124). -
An inspector's numbers in
PropertyGrid:Property::vectorof 2 to 4 components
(PropertyValue::Vector,component_names),Property::angleandProperty::angles,
radians shown in degrees, andshown_as(factor, unit)for any number or vector, the
unit inside each field, so a rotation's fields line up with a position's. A
number's name scrubs it, and a component's its component.NumberField::compact: no
step buttons, the input filling the row.NumberField::with_suffix: a unit shown
muted at the input's end, not part of its text; typed text may end in it or not. -
Toolbar::with_icon_tone(&id, Tone): an action's icon in the theme's success, danger,
warning or info color on a flat button - a green Play, a red Stop. Greyed when disabled;
checked, it keeps the color where it stands out from the pressed fill by 3:1, and takes
the fill's ink where not (on a high-contrast theme's accent). -
A scene's inspector in
PropertyGrid:Property::changedmarks a property and puts a
reset button beside it (PropertyGridEvent::Reset), in a slot every row keeps, empty
where there is nothing to reset, so a changed row's fields line up with the others (a
list's item has its remove button there);Property::mixedand
mixed_componentsshow values that differ between the objects selected, the first
edit for them all (PropertyGridEvent::ComponentChangedfor one component of a
vector).Style::mixed: a checkbox neither on nor off.NumberField::mixedand
Select::mixedshow a dash.Phrase::MixedandPhrase::ResetProperty. -
References in
PropertyGrid:Property::referenceholds aReference(a name and a
picture) or none (PropertyValue::Reference). Its field asks the app to pick
(PropertyGridEvent::PickRequested), its clear button sets none, and with
Property::accepts(kinds)drags of those kinds dropped on it are reported
(PropertyGridEvent::Dropped).Phrase::NoReferenceandPhrase::ClearProperty. -
Rows the app builds in
PropertyGrid:Property::customshows the name and an empty
cell,PropertyGrid::cellgives it to the app to build into after the grid
(PropertyValue::Custom). Up and Down go into it. -
A custom widget that is a drop target hears a drag that it accepts come over it, move
and go:WidgetInput::DragEntered { source, kind, at },DragMoved,DragLeft, and
WidgetInput::Droppedwhere it lands - a viewport placing an asset where it is let
go. -
A game's look:
Style::hover_backgroundandpress_backgroundsay what a pointer
target's fill turns to, in place of the theme's overlays, andStyle::background_image
draws a registered image as the fill in nine parts (NineSlice), tinted under the
pointer.StylePatchhas all three, so a style sheet sets them per name; a theme file
the two colors. -
Focus by direction, for a game's pad or a TV remote:
Ui::focus_directionand
Command::FocusUp,FocusDown,FocusLeftandFocusRightmove the keyboard to the
nearest widget that way on the screen; no key is bound to them.Style::focus_group
withFocusGroup::WraporKeepkeeps a move inside a panel, wrapping round or
holding at its edge (ADR 0126). -
An app's own scale:
Ui::set_app_scalemakes the whole UI bigger or smaller than the
display's scale makes it - a zoom, a game's UI scale - and stays when the display's
scale changes.Ui::scaleis the product;Ui::display_scaleandUi::app_scale
say each.Frame::set_app_scalesets it and rebuilds. -
DockPanel::keep_built: a panel built while another tab of its group shows, hidden, so
it keeps its scroll, its text and the keyboard, which comes back to it when it shows
again.DockPanelhas a fieldkeep_built, saved with the layout. -
TileGrid: the app's items as tiles of one size, a picture over a caption, wrapping
to the width and built only in view - an asset browser. Selection by clicks and keys in
two directions,Activatedon Enter or a double click, renaming in place with F2
(Renamed),ContextRequested, and every tile a drag source with
TileGrid::with_drag_kind.Command::Rename, bound to F2 in both keymaps. -
Lists and maps in
PropertyGrid:Property::listandProperty::maphold items that
are properties of their own, nested, opened and closed by the name
(PropertyGridEvent::ItemsToggled,PropertyGrid::set_items_open,items). + asks
the app to add (AddRequested), an item's button to remove (RemoveRequested), and
a list's item dragged by its handle or moved with Alt+Up and Alt+Down to move
(Moved);PropertyValue::Itemscounts them.Command::MoveUpandMoveDown,
bound to Alt+Up and Alt+Down in both keymaps.Phrase::ItemCount,AddItemand
RemoveItem. -
The pointer locked to a custom widget, for a fly camera:
Ui::lock_pointer,
Ui::unlock_pointerandUi::pointer_lock, andInputCx::lock_pointer,
unlock_pointerandhas_pointer_lock. The widget hearsWidgetInput::PointerLocked,
the mouse's own motion asWidgetInput::Motion(InputEvent::Motion), every button
and the wheel, andPointerUnlockedas the lock ends, at the latest when the window
loses focus; hover and drags stay as they were (ADR 0124). -
Ui::set_continuousandUi::is_continuous: every frame the display shows drawn, for
something that moves all the time, such as a game in a viewport.Ui::last_drawn: when
the last draw list was made (ADR 0123). -
A component's actions in a
PropertyGridgroup's header, as an inspector has them:
PropertyGrid::set_group_actionsputsGroupActions (an id, an icon, a tooltip, and
destructive) at the header's right end; a click reports
PropertyGridEvent::GroupAction, and a right click on the headerGroupContext, for
the app's menu, neither opening nor closing the group.set_group_subtitleshows muted
text beside the group's name - a script's file. Both stay with the groups still there
when the properties are handed over again.PropertyGridParts::header_actionsholds the
buttons, to anchor a menu to. -
Style::hover_foreground: a pointer target's text and icons turn to a color under the
pointer. A destructive header action and a list item's remove button inPropertyGrid
take the theme's danger color so.
forma-wgpu
Added
GpuRequest,Gpu::request_with,Gpu::for_surface_withandGpu::noop_with: a device
with the features and limits an app asks for, on top of forma's.GpuError::Unsupported,
withUnmetLimit, names what an adapter lacks.WindowSurface::set_present_mode,WindowSurface::present_modeand
SurfaceRenderer::set_present_mode: how a window presents, and how many frames may wait.
Changed
- A window presents with
Fifounless told otherwise, where it took the first mode its
surface listed, which need not wait for the display.
forma-winit
Added
- Keys carry their place on the keyboard, from winit's
physical_key. runhides and holds the pointer while a window's UI has it locked: in place where
the system can (Wayland, macOS, the web), else kept in the window and put back as it
moves (X11, Windows). The mouse'sDeviceEvent::MouseMotionreaches the widget holding
it. Theviewportexample turns its scene with the mouse while the right button is
down.- Without its default features forma-winit brings no desktop crate (clipboard, menus,
dialogs, tray, notifications, hotkeys, print): a game's own loop takes it so, as the
guide's "In a game's own loop" says, and CI keeps it so.
Fixed
- An animation - a spinner, a busy bar, a progress bar easing, any transition - no
longer takes a whole core inrun: the loop woke again at once while it waited for
the next frame. It sleeps until then now, as the display paces the frames. 100% of a
core for a spinner, 6% now. - A drop naming over 100,000 files is refused with an error. A dropped path with
a NUL is left out. - Adding to the recent list no longer breaks it where another app wrote an empty
tag (<x/>or<x></x>).
forma-android
Fixed
- Typing faster than the loop answers could lose letters, unseen behind a
password's bullets, and a late state could put bullets into the next field.
The keyboard's states now carry their field and edit. - Moving between two fields of one kind restarts the keyboard's input.
- An unlock with an invalidated key opens the app, where Unlock did nothing.
- A failed save after an unlock is said in logcat. A new save drops the login an
older one left waiting.
forma-app
Added
- The GPU inside
run(ADR 0123):Frame::gpuand
Context::gpuhand out the device the windows draw with, for an app that renders a
scene of its own into a texture it shows by an image handle;Settings::gpuasks for
the features and limits that drawing needs, andSettings::present_modeand
Settings::frame_latencysay how windows present.Frame::set_continuousdraws a
window every frame,Frame::timeandFrame::since_last_framesay when the frame began
and how long since the last. forma-winit's runner, forma-android's andAppHarness
honor them all; theviewportexample of forma-winit shows them. host::RunnerContext::set_gpu, for a runner to hand over its device.Frame::lock_pointerandFrame::unlock_pointer: the pointer locked to a custom widget
by the app, for a game that holds it while it plays.host::next_wakeup_after_frames: when a runner's loop wakes by itself next, leaving
out the windows whose frame is due now.
Fixed
- An activation token from another start over 1024 bytes, or not plain ASCII, is
not used, and that is said on stderr. - The docs of
WindowSettings::msaa: the filled shapes of charts, graphs and
timelines are meshes, and change with it. 0.4.1 said all of forma's looked the
same.
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
- forma-android: an autofill unlock could give another app's logins away.