• v0.5.0 8fa22b843c

    v0.5.0
    Some checks failed
    ci / check (push) Failing after 1h2m48s
    ci / cross (push) Successful in 12m50s
    ci / android (push) Failing after 1m32s
    Stable

    gntx released this 2026-11-13 02:15:41 +01:00 | 0 commits to main since this release

    0.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 new ide example,
    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's viewport
    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 code and Event::Dropped an
    at, DockEvent is no longer Copy, DockPanel has more fields, and FindBar
    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::login could 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 as FillRequest::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_SECURE is set, which
      happens on Android's UI thread: its first frame could come before it.

    forma-ui

    Changed

    • Highlighter colors five more TextMate scopes by their kind: support.class and
      entity.other.inherited-class as types, variable.function as a function,
      variable.language as a keyword and entity.name.constant as a constant. Java's types
      where they are used, its method calls and this were in the text's or the variables'
      color. Other grammars change with it: Rust's and Python's self, JavaScript's this and
      its calls and built-in classes, C's #define names.

    • A key says where it is on the keyboard, whatever the layout: InputEvent::Key has
      code: Option<KeyCode> (ADR 0124). Code that makes
      InputEvent::Key adds code (None if the platform does not say); forma-winit's
      run and WinitInput fill it in.

      // 0.4
      InputEvent::Key { key, pressed: true, repeat: false }
      // 0.5
      InputEvent::Key { key, code: None, pressed: true, repeat: false }
      
    • DockEvent is no longer Copy: CloseRequested holds a list of panels. With tabs
      that can close, offer events with DockArea::handle_all: an entry of a tab's menu
      closes several, each reported, and DockArea::handle returns one.

    • DockPanel has more fields, for editor tabs (Added, below). Code that writes one
      out with its three fields makes it with DockPanel::new and its methods instead.

    • FindBar takes the keyboard when it opens, and gives it back to its text area,
      on the current match, when it closes. FindBar::reveal leaves 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_case and whole_word report
      Event::Clicked, not Event::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::Dropped has at, 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 adds at.

      // 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 unless Style::tab_width says, 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. DiffViewer shows a tab to the next stop rather than
      as four spaces.

    Fixed

    • Two letters typed in one frame open a CodeCompletion as 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_state hide their lines again there.
      They were still folds, in folded_lines and 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::new takes 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

    • TabBar and DockArea: 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 a TabBar
      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_layers with
      IconLayer::draw and IconLayer::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::cut is the cut as an icon of
      its own, drawn in a PDF too. DockPanel::with_icon puts such an icon before a tab's title.

    • A Chooser that 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 reports Event::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
      CloseRequested for a panel that asks. Style::clicks_any_button() makes a clickable
      panel report middle, back and forward clicks as Clicked with 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, TextLinkHoverEnded and TextLinkPressed, and
      Ui::set_link_range. The ide example 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() and MarkdownStyle::padding, for Markdown in a small card;
      CodeItem::documentation_markdown and CodeCompletion::set_documentation_markdown
      (markdown feature). The ide example 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) and Style::show_whitespace (with
      ShowWhitespace): a code editor's indent guides, rulers and spaces and tabs marked, at
      the area's tab stops. The ide example's editor shows the guides.

    • LogViewer::with_frame(false): a log without its border and rounded corners, beside an
      editor that has none.

    • A SplitButton takes the variant of the style it is given, both parts filled, outlined
      or bare alike, a line parting a fill. A Primary one 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_width sets it for every text area of a theme ("text_area": { "tab_width": 4 } in a theme file), and LogViewer::with_tab_width and
      DiffViewer::with_tab_width for theirs (8 and 4 without it).

    • TextState carries 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_lines counts
      them and TextState::drop_shaped_lines lets them go, for an app with many large files
      open (ADR 0120).

    • Highlighter::update_within: what update does, a slice a frame, as a whole file on
      the UI thread is most of a second at 10,000 lines. update of a text moved to another
      area with Ui::put_text_state no longer highlights it again.

    • Style::match_brackets: the bracket beside the caret marked, with its pair.

    • For editor tabs, on DockPanel: modified, subtitle, tooltip, preview and
      confirm_close, with DockLayout::panel, panel_mut, open_preview and
      keep_preview. DockEvent::CloseRequested and DockArea::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,
      CloseToTheRight and CloseAll.

    • terminal::Terminal, with ShellOptions, TerminalEvent and TerminalParts, behind
      the terminal feature, on the desktop: a shell in a widget, on alacritty_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, and code as InputEvent::Key has it). LayoutCx::text_in:
      italic text.

    • Style::gutter_background and Style::gutter_separator: a gutter set apart from the
      text. Style::no_focus_ring: for a widget that shows the focus itself.

    • Terminal shows 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_zooms and Event::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_size changes keeps the same line at the top, and TextState carries 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_query and search_selection for 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_color and detail_rich, and CodeItem's: an icon in a color
      and a detail in its own colors. Chooser::with_search_by_app and
      set_empty_text, for a search the app does itself.

    • DockLayout::dock_sized and set_title.

    • Ui::offset_at_position and Ui::position_at_offset, with TextPosition and
      PositionEncoding: a place in a text in UTF-8, UTF-16 or UTF-32.

    • Style::text_hover, Event::TextHovered, Event::TextHoverEnded and
      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_rect and
      Popover::with_rect place a popover beside a rectangle.

    • widgets::CodeCompletion, with CodeItem, CodeCompletionEvent,
      CodeCompletionParts, CompletionReason and Ranking. Command::Complete, on
      Ctrl+Space, opens it.

    • Ui::take_text_state and Ui::put_text_state, with TextState: 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::PointerEntered and PointerLeft: the
      pointer came onto a custom widget and went off it. Harness::key_down and key_up
      hold a key and let it go (ADR 0124).

    • An inspector's numbers in PropertyGrid: Property::vector of 2 to 4 components
      (PropertyValue::Vector, component_names), Property::angle and Property::angles,
      radians shown in degrees, and shown_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::changed marks 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::mixed and
      mixed_components show values that differ between the objects selected, the first
      edit for them all (PropertyGridEvent::ComponentChanged for one component of a
      vector). Style::mixed: a checkbox neither on nor off. NumberField::mixed and
      Select::mixed show a dash. Phrase::Mixed and Phrase::ResetProperty.

    • References in PropertyGrid: Property::reference holds a Reference (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::NoReference and Phrase::ClearProperty.

    • Rows the app builds in PropertyGrid: Property::custom shows the name and an empty
      cell, PropertyGrid::cell gives 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::Dropped where it lands - a viewport placing an asset where it is let
      go.

    • A game's look: Style::hover_background and press_background say what a pointer
      target's fill turns to, in place of the theme's overlays, and Style::background_image
      draws a registered image as the fill in nine parts (NineSlice), tinted under the
      pointer. StylePatch has 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_direction and
      Command::FocusUp, FocusDown, FocusLeft and FocusRight move the keyboard to the
      nearest widget that way on the screen; no key is bound to them. Style::focus_group
      with FocusGroup::Wrap or Keep keeps a move inside a panel, wrapping round or
      holding at its edge (ADR 0126).

    • An app's own scale: Ui::set_app_scale makes 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::scale is the product; Ui::display_scale and Ui::app_scale
      say each. Frame::set_app_scale sets 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. DockPanel has a field keep_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, Activated on 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::list and Property::map hold 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::Items counts them. Command::MoveUp and MoveDown,
      bound to Alt+Up and Alt+Down in both keymaps. Phrase::ItemCount, AddItem and
      RemoveItem.

    • The pointer locked to a custom widget, for a fly camera: Ui::lock_pointer,
      Ui::unlock_pointer and Ui::pointer_lock, and InputCx::lock_pointer,
      unlock_pointer and has_pointer_lock. The widget hears WidgetInput::PointerLocked,
      the mouse's own motion as WidgetInput::Motion (InputEvent::Motion), every button
      and the wheel, and PointerUnlocked as the lock ends, at the latest when the window
      loses focus; hover and drags stay as they were (ADR 0124).

    • Ui::set_continuous and Ui::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 PropertyGrid group's header, as an inspector has them:
      PropertyGrid::set_group_actions puts GroupActions (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 header GroupContext, for
      the app's menu, neither opening nor closing the group. set_group_subtitle shows 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_actions holds 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 in PropertyGrid
      take the theme's danger color so.

    forma-wgpu

    Added

    • GpuRequest, Gpu::request_with, Gpu::for_surface_with and Gpu::noop_with: a device
      with the features and limits an app asks for, on top of forma's. GpuError::Unsupported,
      with UnmetLimit, names what an adapter lacks.
    • WindowSurface::set_present_mode, WindowSurface::present_mode and
      SurfaceRenderer::set_present_mode: how a window presents, and how many frames may wait.

    Changed

    • A window presents with Fifo unless 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.
    • run hides 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's DeviceEvent::MouseMotion reaches the widget holding
      it. The viewport example 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 in run: 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::gpu and
      Context::gpu hand 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::gpu asks for
      the features and limits that drawing needs, and Settings::present_mode and
      Settings::frame_latency say how windows present. Frame::set_continuous draws a
      window every frame, Frame::time and Frame::since_last_frame say when the frame began
      and how long since the last. forma-winit's runner, forma-android's and AppHarness
      honor them all; the viewport example of forma-winit shows them.
    • host::RunnerContext::set_gpu, for a runner to hand over its device.
    • Frame::lock_pointer and Frame::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