Draft Editor API and TextEditor widget

This commit is contained in:
Héctor Ramón Jiménez 2023-09-12 14:51:00 +02:00
parent 346af3f8b0
commit 6448429103
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
25 changed files with 1384 additions and 92 deletions

View file

@ -32,6 +32,7 @@ use crate::core::text::{self, Text};
use crate::core::{
Background, Color, Font, Pixels, Point, Rectangle, Size, Vector,
};
use crate::graphics::text::Editor;
use crate::graphics::text::Paragraph;
use crate::graphics::Mesh;
@ -159,6 +160,7 @@ impl<T> core::Renderer for Renderer<T> {
impl<T> text::Renderer for Renderer<T> {
type Font = Font;
type Paragraph = Paragraph;
type Editor = Editor;
const ICON_FONT: Font = iced_tiny_skia::Renderer::<T>::ICON_FONT;
const CHECKMARK_ICON: char = iced_tiny_skia::Renderer::<T>::CHECKMARK_ICON;
@ -179,14 +181,27 @@ impl<T> text::Renderer for Renderer<T> {
fn fill_paragraph(
&mut self,
text: &Self::Paragraph,
paragraph: &Self::Paragraph,
position: Point,
color: Color,
) {
delegate!(
self,
renderer,
renderer.fill_paragraph(text, position, color)
renderer.fill_paragraph(paragraph, position, color)
);
}
fn fill_editor(
&mut self,
editor: &Self::Editor,
position: Point,
color: Color,
) {
delegate!(
self,
renderer,
renderer.fill_editor(editor, position, color)
);
}