summaryrefslogtreecommitdiffstats
path: root/core/src/renderer
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-12 14:51:00 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-12 14:51:00 +0200
commit6448429103c9c82b90040ac5a5a097bdded23f82 (patch)
tree79582bde4a7d6df71df0abefe35146b06452409f /core/src/renderer
parent346af3f8b0baa418fd37b878bc2930ff0bd57cc0 (diff)
downloadiced-6448429103c9c82b90040ac5a5a097bdded23f82.tar.gz
iced-6448429103c9c82b90040ac5a5a097bdded23f82.tar.bz2
iced-6448429103c9c82b90040ac5a5a097bdded23f82.zip
Draft `Editor` API and `TextEditor` widget
Diffstat (limited to 'core/src/renderer')
-rw-r--r--core/src/renderer/null.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/core/src/renderer/null.rs b/core/src/renderer/null.rs
index 0ffd3649..adf75969 100644
--- a/core/src/renderer/null.rs
+++ b/core/src/renderer/null.rs
@@ -43,6 +43,7 @@ impl Renderer for Null {
impl text::Renderer for Null {
type Font = Font;
type Paragraph = ();
+ type Editor = ();
const ICON_FONT: Font = Font::DEFAULT;
const CHECKMARK_ICON: char = '0';
@@ -66,6 +67,14 @@ impl text::Renderer for Null {
) {
}
+ fn fill_editor(
+ &mut self,
+ _editor: &Self::Editor,
+ _position: Point,
+ _color: Color,
+ ) {
+ }
+
fn fill_text(
&mut self,
_paragraph: Text<'_, Self::Font>,
@@ -106,3 +115,32 @@ impl text::Paragraph for () {
None
}
}
+
+impl text::Editor for () {
+ type Font = Font;
+
+ fn with_text(_text: &str) -> Self {}
+
+ fn cursor(&self) -> text::editor::Cursor {
+ text::editor::Cursor::Caret(Point::ORIGIN)
+ }
+
+ fn perform(&mut self, _action: text::editor::Action) {}
+
+ fn bounds(&self) -> Size {
+ Size::ZERO
+ }
+
+ fn min_bounds(&self) -> Size {
+ Size::ZERO
+ }
+
+ fn update(
+ &mut self,
+ _new_bounds: Size,
+ _new_font: Self::Font,
+ _new_size: Pixels,
+ _new_line_height: text::LineHeight,
+ ) {
+ }
+}