4759 Commits
Author SHA1 Message Date
FredApps 6525c87923 Merge pull request #53 from storytold/perf/font-cache-revision
epaint: identify reusable font layouts without shaping text
2026-11-20 19:31:23 +07:00
FredApps 93508ec88d epaint: identify reusable font layouts without shaping text 2026-11-20 13:11:35 +01:00
aiongg 1a44fd11cd egui: PassRecords::first_difference takes only positions within the tolerance
A RecordShift moves points, rects, clip rects and AccessKit bounds, and
nothing else: stroke widths, radii, blur widths, angles, opacity and
texture coordinates now compare exactly, so a replay that samples a
neighbouring atlas region or keeps a stale opacity is a difference.
Imports from core and alloc where clippy asks for them.
2026-11-20 10:57:40 +00:00
aiongg b65cbd8d92 egui: PassRecords::first_difference compares geometry within a tolerance
Records moved by a whole pixel from positions off the float grid differ from the part run at the new place by
rounding only. Positions, sizes, widths, angles, texture coordinates and AccessKit bounds compare within the given
tolerance; ids, counts, colours and text stay exact.
2026-11-20 09:35:50 +00:00
aiongg dd086c7f29 epaint: Fonts::atlas_generation names the font atlas a galley's glyphs point into
A new value whenever the atlas is made, cleared or rebuilt with new options, unique in the process. Kept paint that
holds text (a replayed record) is valid only under the generation it was made in.
2026-11-20 07:49:54 +00:00
aiongg bcdeb7bb82 egui: a part's records hold the widgets a sizing pass registered first; no empty shapes or sizing widgets
A visible Ui's registration of a widget that only invisible (sizing-pass) Uis registered so far replaces the widget
rect and takes its place at the top of its layer. Widget rects carry when they took their place, and
pass_records_since finds a part's widgets by it, so a part holds the widgets a sizing pass registered before its
mark. Records leave out Shape::Noop shapes, layers left empty, and widgets neither visible nor enabled.
PassRecords::shifted gives the records as a replay at a RecordShift adds them. Ui::new disables before it registers
its widget, as new_child does.
2026-11-19 20:37:50 +00:00
aiongg 2d59bcacf2 egui: replay pass records at another place (RecordShift)
replay_pass_records takes a RecordShift: shapes, widget rects and AccessKit bounds move by its
offset in layer space; a clip rect equal to the clip the part ran under becomes the new clip, and
one set inside the part moves with it, cut by the new clip. PassRecords::paints_callback says
whether records hold a paint callback, which a replay adds only where it was made.
2026-11-19 15:58:17 +00:00
aiongg 7e1c30d142 egui: pass records keep a stable layer order; a paint callback cannot be compared
`pass_records_since` gives shapes and widget rects with their layers sorted by order and id, since the maps they
come from have no stable order. `first_difference` reports a paint callback on either side as
`PassRecordsDiff::Callback`: a backend wraps every callback in one type, so neither its type nor its rect tells
whether two callbacks paint the same. Its doc says what the records cover and what they don't, and `Display` shows
the variant, index and rects only. PATCHES.md lists the pass records (E36), `HarnessBuilder::with_context` (E37) and
this comparison (E38).
2026-11-19 07:52:46 +00:00
aiongg 96ccc118b8 egui: PassRecords::first_difference names the first record two pass records differ in
Shapes layer by layer, then widget rects, AccessKit nodes and AccessKit parents compare with `==`, except a paint
callback, which compares by its rect and its callback's type: each run makes a new callback, and `PaintCallback`'s
`PartialEq` compares the callback by pointer. `PassRecordsDiff` gives the kind, the index and the record on each side.
2026-11-19 07:38:02 +00:00
aiongg e9711ca9b6 egui_kittest: HarnessBuilder::with_context runs the harness on a given context 2026-11-15 08:40:55 +00:00
aiongg 5d6f991d51 egui: Context::widget_rect_last_pass reads a widget's rect from the last finished pass 2026-11-14 23:39:00 +00:00
aiongg dcd4de1fbc egui: a Popup stays directly above the layer it opened from; sublayers nest, and a listed layer moves with its whole sublayer tree
Popup::show makes its area a sublayer of the layer it opened from when both share an Order (tooltips aside). Areas::end_pass follows each layer with its whole sublayer tree, depth first, and set_layer_order moves a listed layer with all of its unlisted descendants.
2026-11-13 17:48:36 +00:00
aiongg 8026738cf6 egui: Event::SystemTheme reports the OS's light or dark preference when the integration first knows it and on each change
egui-winit sends it from State::new and on WindowEvent::ThemeChanged; eframe web
at start and on the prefers-color-scheme change. RawInput::system_theme keeps
the same value; the event is the change notice.
2026-11-13 16:38:56 +00:00
aiongg 620ee205d4 PATCHES.md: E32 retired IME reset requests 2026-11-13 16:14:52 +00:00
aiongg fe5f026b89 eframe web: report dropped and failed reset requests as Event::ImeResetRetired
AppRunner forwards PlatformOutput::retired_ime_resets, and a reset the text
agent cannot complete (descriptor no longer matches, local replacement failed)
is reported retired in the next raw batch, with a repaint, as complete_reset
does for a completion.
2026-11-13 16:05:24 +00:00
aiongg 9b1f60c605 egui: Event::ImeResetRetired reports a reset request the integration dropped without a completion
egui-winit's ResetBridge reports every request it drops (focus loss, window
destroyed, IME disallowed, another IME context, a newer request), and
PlatformOutput::append reports a request a later pass drops in
PlatformOutput::retired_ime_resets, which egui-winit forwards. A custom editor
waiting for the completion asks again instead of waiting forever.
2026-11-13 15:38:36 +00:00
aiongg 42e34e2acf egui: Memory::set_focus_surrender, a focused widget's own rule for a press or click elsewhere 2026-11-12 08:50:16 +00:00
aiongg 5493e3aab8 PATCHES.md: E30, the kittest eframe harness runs raw_input_hook 2026-11-12 08:20:27 +00:00
aiongg 6d3bd58e88 egui_kittest: the eframe harness runs App::raw_input_hook before every pass, as eframe does 2026-11-12 08:19:48 +00:00
aiongg 3f56db2d93 Context::pass_mark, pass_records_since and replay_pass_records
A part of a pass can be recorded (its shapes, widget rects and AccessKit
nodes) and added again in a later pass in place of running it.
2026-11-11 21:06:51 +00:00
aiongg 4b93a86c52 Context::ptr_eq 2026-11-07 07:00:42 +00:00
aiongg eba925c51a IdTypeMap: insert_temp_boxed keeps the allocation of a value taken out with remove_temp_raw 2026-11-07 06:56:09 +00:00
aiongg 24d935bc78 egui: lint expectation on the sublayer loop 2026-11-06 22:35:44 +00:00
aiongg 463fff0569 egui: set_layer_order moves unlisted sublayers with their listed parent 2026-11-06 22:35:07 +00:00
aiongg 7de8579080 egui: make Context::register_accesskit_parent public 2026-11-06 22:33:42 +00:00
aiongg 8b98271554 egui: Context::set_layer_order 2026-11-06 22:33:12 +00:00
aiongg 35a72e6b78 egui: let a popup swallow the press outside it 2026-10-31 10:28:48 +00:00
aiongg 94a2ac9917 egui: DragAndDrop::aborted_by_escape 2026-10-28 21:41:44 +00:00
aiongg b1f17dc995 egui: give each pointer press to the widget under the press position 2026-10-28 21:41:44 +00:00
aiongg d1316b802e egui: Context::set_accesskit_focus 2026-10-28 21:41:44 +00:00
aiongg c2d3a8f35b egui: accessible names for ScrollArea scroll bars
Add ScrollArea::horizontal_scroll_bar_label and vertical_scroll_bar_label.
The scroll bar AccessKit node had no name, which fails WCAG 4.1.2. The
labels are per axis because a name cannot be composed from a shared
string in every language, and egui has no built-in UI text.
2026-10-28 19:38:15 +00:00
aiongg ef6c37d93b egui: format describe_for_accessibility test 2026-10-28 12:53:39 +00:00
aiongg d46b817e4f egui: make Response::describe_for_accessibility public 2026-10-28 12:53:28 +00:00
aiongg 0048c06a81 End a TextEdit's composition when a new IME context starts
A composition belongs to the focused IME context it began in. An editor
that comes back after a pass it was not shown in, or gains the focus,
starts a new context; its old composition ends there, the pre-edit text
kept in the buffer as typed and the cursor at its end. `preedit()` is
then `None`, so a widget wrapping `TextEdit` no longer sees stale
marked text in a field refocused in the pass it reappears.
2026-10-28 11:42:23 +00:00
aiongg 8f0cc50da6 Add TextEditState::preedit
The IME composition under way: the character range of the pre-edit
(marked) text in the buffer and that text, or `None` when nothing is
composing. While composing, the buffer holds the marked text beside the
committed text; a widget that wraps a `TextEdit` and reports only
committed text removes this range, and shows the same buffer in the next
pass so the composition goes on.
2026-10-28 11:10:19 +00:00
aiongg 3df8969532 Add InteractOptions::activate_on_space
Enter and Space both act as a click on a focused widget. With
`activate_on_space: false`, only Enter does, as for a link: Space
doesn't activate a link, it scrolls the page in a browser. Defaults to
true, which keeps the current behaviour.
2026-10-28 09:46:51 +00:00
aiongg 34dc5998f4 Add Memory::request_focus_with_filter
Requests focus together with the event filter the widget keeps while
focused. `set_focus_lock_filter` only applies once the widget had focus
for a pass, so a widget that moves focus to a sibling on an arrow key
(a radio group) lost it to egui's directional focus when a second arrow
key came in the pass right after the request.
2026-10-28 09:32:50 +00:00
aiongg 4ae6373594 Add InteractOptions::enabled to disable one widget of an enabled Ui
`Ui::interact_opt` registers the widget as enabled only if both the `Ui`
and `InteractOptions::enabled` are. A widget can then draw its own
disabled look without a disabled child `Ui`, which would fade its
painter, add a node to the accessibility tree and shift the auto-ids of
the widgets after it.
2026-10-28 09:32:22 +00:00
aiongg e8cd5cb48d epaint: OpenType features per text section
TextFormat::font_features lists OpenType features (tag, value) that the
shaper applies to that section's runs, e.g. tnum for tabular figures.
The list is empty by default, which shapes exactly as before, and is part
of TextFormat's hash, so the galley cache keeps text with and without
features apart. RichText gains font_feature() and font_features().

Tests use a 3 KB digits-only subset of Space Grotesk (OFL), whose default
digits are proportional.
2026-10-28 06:33:38 +00:00
skylartaylor 6d518fc799 Add ordered IME reset completion across native and web adapters 2026-10-24 14:41:32 +02:00
skylartaylor a1db03affb Reconcile 0.36.2 fork history into the 0.37 migration
Preserve the reviewed 0.37 source tree and canonical dependency pins while
recording the existing Craft fixes from craft/0.36.2 in its ancestry.
All runtime files remain byte-identical to the published migration commit.
2026-10-24 09:24:00 +02:00
skylartaylor 173cc7375d Complete egui 0.37 text, IME and Wayland clipboard integration 2026-10-24 05:19:03 +02:00
aiongg a4f9a17f64 PATCHES.md: E12 bidi controls 2026-10-21 21:37:34 +00:00
aiongg 59d189ffdb Merge craft/bidi-direction
# Conflicts:
#	crates/epaint/src/text/text_layout.rs
2026-10-21 21:37:34 +00:00
aiongg 620e070e2a epaint: keep the levels of zero-width bidi controls when reordering a row
A zero-width glyph joined the block before it and took that block's level,
so an isolate initiator, PDI or RLM could no longer separate two runs: two
Latin isolates in right-to-left text read as one run, and a Hebrew isolate
followed by a Latin one came out left to right. A zero-width glyph now joins
the block before it only at the same level.
2026-10-21 21:37:14 +00:00
aiongg a7bc087cf4 PATCHES.md: E4 2026-10-21 18:09:55 +00:00
aiongg 8778579e39 Merge craft/wayland-clipboard 2026-10-21 18:09:49 +00:00
Carmine Paolino 66bacf234a E4: egui-winit: use winit's Wayland clipboard instead of smithay-clipboard when available
Port of emilk/egui#8657 (draft) to 0.36.2, the companion of W15 (rust-windowing/winit#4729): winit now binds a wl_data_device per seat for file drops, and a second device from smithay-clipboard loses the selection on compositors that serve only the first device per client (Hyprland). With winit's clipboard available, smithay-clipboard is not started. Only the clipboard.rs change is taken; the PR's temporary [patch] of egui's own winit is not.

On 0.37, `Clipboard::new` stays `unsafe`. While winit's clipboard is in use, the
PRIMARY selection goes through arboard: W15 offers only the regular selection.
2026-10-21 18:09:40 +00:00
aiongg 137398e64e Patch winit to aiongg/winit craft/0.30.13-lang
storytold/winit craft/0.30.13 (W1–W15) with the language-support
patches on top (W17–W27). It has the same IME, Latin-layout and
delete-surrounding APIs as craft/suite, and W15's Wayland clipboard
(platform::wayland::Clipboard) that E4 uses.
2026-10-21 18:09:19 +00:00
aiongg aa1ba0b4b4 Merge craft/latin-letter-keys 2026-10-21 18:01:29 +00:00