mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: rename phrase
This commit is contained in:
parent
db2a2efa63
commit
4081c23aea
2 changed files with 21 additions and 2 deletions
|
|
@ -52,7 +52,18 @@ impl Content for PhrasePool<Tui> {
|
|||
} else {
|
||||
color //Color::Rgb(28, 35, 25)
|
||||
}))?;
|
||||
if self.focused && i == self.phrase { add(&CORNERS)?; }
|
||||
match self.mode {
|
||||
None => {
|
||||
if self.focused && i == self.phrase { add(&CORNERS)?; }
|
||||
},
|
||||
Some(PhrasePoolMode::Rename(phrase)) => {
|
||||
if self.focused && i == phrase {
|
||||
add(&CORNERS)?;
|
||||
add(&"Rename")?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
})
|
||||
)
|
||||
|
|
@ -104,6 +115,9 @@ impl Handle<Tui> for PhrasePool<Tui> {
|
|||
let mut phrase = self.phrases[self.phrase].write().unwrap();
|
||||
phrase.color = random_color();
|
||||
},
|
||||
key!(KeyCode::Char('n')) => { // change name
|
||||
self.mode = Some(PhrasePoolMode::Rename(self.phrase));
|
||||
},
|
||||
_ => return Ok(None),
|
||||
}
|
||||
return Ok(Some(true))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue