mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
add/insert/duplicate phrase directly from grid
This commit is contained in:
parent
dc32c2c2b8
commit
de4797ab52
2 changed files with 17 additions and 5 deletions
|
|
@ -124,12 +124,12 @@ impl Handle<Tui> for PhrasePool<Tui> {
|
|||
let mut phrase = Phrase::default();
|
||||
phrase.name = Arc::new(RwLock::new("(no name)".to_string()));
|
||||
phrase.color = random_color();
|
||||
self.phrases.insert(self.phrase, Arc::new(RwLock::new(phrase)));
|
||||
self.phrases.insert(self.phrase + 1, Arc::new(RwLock::new(phrase)));
|
||||
self.phrase += 1;
|
||||
},
|
||||
key!(KeyCode::Char('d')) => { // insert duplicate
|
||||
let phrase = (*self.phrases[self.phrase].read().unwrap()).clone();
|
||||
self.phrases.insert(self.phrase, Arc::new(RwLock::new(phrase)));
|
||||
self.phrases.insert(self.phrase + 1, Arc::new(RwLock::new(phrase)));
|
||||
self.phrase += 1;
|
||||
},
|
||||
key!(KeyCode::Char('c')) => { // change color
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue