mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
show phrase length in list
This commit is contained in:
parent
efdc135cae
commit
ea88622081
2 changed files with 11 additions and 2 deletions
|
|
@ -133,6 +133,12 @@ pub trait Layout<E: Engine>: Widget<Engine = E> + Sized {
|
|||
fn align_center (self) -> Align<Self> {
|
||||
Align::Center(self)
|
||||
}
|
||||
fn align_w (self) -> Align<Self> {
|
||||
Align::W(self)
|
||||
}
|
||||
fn align_e (self) -> Align<Self> {
|
||||
Align::E(self)
|
||||
}
|
||||
fn align_x (self) -> Align<Self> {
|
||||
Align::X(self)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,11 @@ impl Content for PhrasePool<Tui> {
|
|||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
let content = col!(
|
||||
(i, phrase) in self.phrases.iter().enumerate() => Layers::new(|add|{
|
||||
let Phrase { ref name, color, .. } = *phrase.read().unwrap();
|
||||
let row1 = format!(" {i}");
|
||||
let Phrase { ref name, color, length, .. } = *phrase.read().unwrap();
|
||||
let row1 = lay!(
|
||||
format!(" {i}").align_w().fill_x(),
|
||||
format!("{length} ").align_e().fill_x(),
|
||||
).fill_x();
|
||||
let row2 = if let Some(PhrasePoolMode::Rename(phrase, _)) = self.mode {
|
||||
if self.focused && i == phrase {
|
||||
format!(" {}▄", name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue