From b302229d7c98133f57b25cea9b7e0cd580945769 Mon Sep 17 00:00:00 2001 From: Joscha Date: Tue, 2 Jan 2024 17:17:30 +0100 Subject: [PATCH] Mention that F1 popup can be scrolled --- CHANGELOG.md | 1 + cove/src/ui/key_bindings.rs | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1532cc..0e2bb08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Procedure when bumping the version number: - The default euph domain is now https://euphoria.leet.nu/ everywhere - The config file format was changed to support multiple euph servers with different domains. Options previously located at `euph.rooms.*` should be reviewed and moved to `euph.servers."euphoria.leet.nu".rooms.*`. +- Tweaked F1 popup ### Fixed - Room deletion popup accepting any room name diff --git a/cove/src/ui/key_bindings.rs b/cove/src/ui/key_bindings.rs index 679c929..8fceda6 100644 --- a/cove/src/ui/key_bindings.rs +++ b/cove/src/ui/key_bindings.rs @@ -79,7 +79,23 @@ pub fn widget<'a>( render_group_info(&mut list_builder, group_info); } - Popup::new(list_builder.build(list), "Key bindings") + let scroll_info_style = Style::new().grey().italic(); + let scroll_info = Styled::new("(Scroll with ", scroll_info_style) + .and_then(format_binding(&config.keys.cursor.down)) + .then(" and ", scroll_info_style) + .and_then(format_binding(&config.keys.cursor.up)) + .then(")", scroll_info_style); + + let inner = Join2::vertical( + list_builder.build(list).segment(), + Text::new(scroll_info) + .float() + .with_center_h() + .segment() + .with_growing(false), + ); + + Popup::new(inner, "Key bindings") } pub fn handle_input_event(