Skip to content

Add struct kas::text::ConfiguredDisplay; replace trait Editor with struct#682

Merged
dhardy merged 21 commits intomasterfrom
push-lytuxqxptqmx
Mar 17, 2026
Merged

Add struct kas::text::ConfiguredDisplay; replace trait Editor with struct#682
dhardy merged 21 commits intomasterfrom
push-lytuxqxptqmx

Conversation

@dhardy
Copy link
Copy Markdown
Collaborator

@dhardy dhardy commented Mar 16, 2026

This adds a new abstraction: kas::text::ConfiguredDisplay is somewhere between TextDisplay and Text in that it contains the TextDisplay, TextClass, FontSelector, Rect, Status etc. but not the actual text (or the text formatter).

The text editor Component uses ConfiguredDisplay instead of Text internally, allowing the highlighter to be moved out of struct EditorComponent. This removes the need for generics here, and thus the motivation for using a trait, allowing a revert of #676 (motivation: simplicity).

EditBox, EditField and dialog::TextEdit now all deref to Target = Editor (non-mut only) and have fn edit(..) supporting usage of &mut self methods on Editor (this allows correctly calling EditGuard::edit and Component::prepare afterwards).

Basic text-drawing fns (using kas::theme::Text) have been removed from DrawCx (replaced with methods on Text).

kas::theme::Text is moved to kas::text::Text.

@dhardy dhardy force-pushed the push-lytuxqxptqmx branch from 8878bd4 to a8195f9 Compare March 16, 2026 17:04
@dhardy dhardy merged commit ab005e2 into master Mar 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant