mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
put phrases from pool in arrangement
This commit is contained in:
parent
dc3edc86ff
commit
96ca1e148b
4 changed files with 14 additions and 4 deletions
|
|
@ -27,7 +27,7 @@ pub struct PhrasePool<E: Engine> {
|
|||
/// Highlighted phrase
|
||||
pub phrase: usize,
|
||||
/// Phrases in the pool
|
||||
pub phrases: Vec<Arc<RwLock<Option<Phrase>>>>,
|
||||
pub phrases: Vec<Arc<RwLock<Phrase>>>,
|
||||
/// Whether this widget is focused
|
||||
pub focused: bool,
|
||||
}
|
||||
|
|
@ -126,10 +126,13 @@ impl<E: Engine> PhrasePool<E> {
|
|||
_engine: Default::default(),
|
||||
scroll: 0,
|
||||
phrase: 0,
|
||||
phrases: vec![Arc::new(RwLock::new(Some(Phrase::default())))],
|
||||
phrases: vec![Arc::new(RwLock::new(Phrase::default()))],
|
||||
focused: false
|
||||
}
|
||||
}
|
||||
pub fn phrase (&self) -> &Arc<RwLock<Phrase>> {
|
||||
&self.phrases[self.phrase]
|
||||
}
|
||||
}
|
||||
impl<E: Engine> PhraseEditor<E> {
|
||||
pub fn new () -> Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue