Decouple caching from Paragraph API

This commit is contained in:
Héctor Ramón Jiménez 2024-07-17 18:47:58 +02:00
parent 616689ca54
commit ffb520fb37
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
7 changed files with 128 additions and 95 deletions

View file

@ -6,7 +6,8 @@ use crate::core::layout;
use crate::core::mouse;
use crate::core::overlay;
use crate::core::renderer;
use crate::core::text::{self, Paragraph as _, Text};
use crate::core::text::paragraph;
use crate::core::text::{self, Text};
use crate::core::touch;
use crate::core::widget::tree::{self, Tree};
use crate::core::{
@ -622,8 +623,8 @@ struct State<P: text::Paragraph> {
keyboard_modifiers: keyboard::Modifiers,
is_open: bool,
hovered_option: Option<usize>,
options: Vec<P>,
placeholder: P,
options: Vec<paragraph::Plain<P>>,
placeholder: paragraph::Plain<P>,
}
impl<P: text::Paragraph> State<P> {
@ -635,7 +636,7 @@ impl<P: text::Paragraph> State<P> {
is_open: bool::default(),
hovered_option: Option::default(),
options: Vec::new(),
placeholder: P::default(),
placeholder: paragraph::Plain::default(),
}
}
}