From 94e7e8f628eb45018f0921c503a216ee946a997b Mon Sep 17 00:00:00 2001 From: Russell Schmidt Date: Fri, 17 Jan 2025 12:49:39 -0600 Subject: [PATCH 1/2] Make dialog "Ok" look highlighted --- ui/dialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/dialog.py b/ui/dialog.py index 52ff128..f6e9fad 100644 --- a/ui/dialog.py +++ b/ui/dialog.py @@ -25,7 +25,7 @@ def dialog(stdscr, title, message): win.addstr(2 + i, 2, l) # Add button - win.addstr(dialog_height - 2, (dialog_width - 4) // 2, " Ok ") + win.addstr(dialog_height - 2, (dialog_width - 4) // 2, " Ok ", curses.color_pair(3)) # Refresh dialog window win.refresh() From fe1eaacee99a79c7ef5cb500e7bcc8b307ef3851 Mon Sep 17 00:00:00 2001 From: Russell Schmidt Date: Fri, 17 Jan 2025 12:55:43 -0600 Subject: [PATCH 2/2] Make dialog easier to get out of --- ui/dialog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/dialog.py b/ui/dialog.py index f6e9fad..b7c215c 100644 --- a/ui/dialog.py +++ b/ui/dialog.py @@ -33,7 +33,8 @@ def dialog(stdscr, title, message): # Get user input while True: char = win.getch() - if char == curses.KEY_ENTER or char == 10 or char == 13: + # Close dialog with enter, space, or esc + if char in(curses.KEY_ENTER, 10, 13, 32, 27): win.clear() win.refresh() return