From ba35a606a80d0356dc55474fcc8c0a21774ed6a6 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 6 Aug 2022 23:54:43 +0200 Subject: [PATCH] Increase F1 key binding column width --- src/ui/input.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/input.rs b/src/ui/input.rs index bcd366f..fbcf8ad 100644 --- a/src/ui/input.rs +++ b/src/ui/input.rs @@ -67,6 +67,9 @@ pub(crate) use key; pub struct KeyBindingsList(List); impl KeyBindingsList { + /// Width of the left column of key bindings. + const BINDING_WIDTH: u16 = 20; + pub fn new(state: &ListState) -> Self { Self(state.widget()) } @@ -109,7 +112,7 @@ impl KeyBindingsList { let widget = HJoin::new(vec![ Segment::new( Resize::new(Padding::new(Text::new((binding, Self::binding_style()))).right(1)) - .min_width(16), + .min_width(Self::BINDING_WIDTH), ), Segment::new(Text::new(description)), ]); @@ -118,7 +121,7 @@ impl KeyBindingsList { pub fn binding_ctd(&mut self, description: &str) { let widget = HJoin::new(vec![ - Segment::new(Resize::new(Empty::new()).min_width(16)), + Segment::new(Resize::new(Empty::new()).min_width(Self::BINDING_WIDTH)), Segment::new(Text::new(description)), ]); self.0.add_unsel(widget);