:: commit c3f5f0d6fd3e27f9b03268e82be45dda51be53c4

mintsuki <mintsuki@protonmail.com> — 2021-07-08 14:07

parents: a39a588b0e

menu: Nicely box boot menu

diff --git a/stage23/menu.c b/stage23/menu.c
index b8c1e84a..f59aff6e 100644
--- a/stage23/menu.c
+++ b/stage23/menu.c
@@ -552,7 +552,33 @@ refresh:
         goto autoboot;
     }
 
-    int max_entries = print_tree("    ", 0, 0, selected_entry, menu_tree,
+    {   // Draw box around boot menu
+        int x, y;
+        get_cursor_pos(&x, &y);
+
+        print("\xda");
+        for (int i = 0; i < term_cols - 2; i++) {
+            print("\xc4");
+        }
+        print("\xbf");
+
+        for (int i = y + 1; i < term_rows - 2; i++) {
+            set_cursor_pos(0, i);
+            print("\xb3");
+            set_cursor_pos(term_cols - 1, i);
+            print("\xb3");
+        }
+
+        print("\xc0");
+        for (int i = 0; i < term_cols - 2; i++) {
+            print("\xc4");
+        }
+        print("\xd9");
+
+        set_cursor_pos(x, y + 2);
+    }
+
+    int max_entries = print_tree("\xb3   ", 0, 0, selected_entry, menu_tree,
                                  &selected_menu_entry);
 
     {
@@ -575,7 +601,8 @@ refresh:
     if (skip_timeout == false) {
         print("\n\n");
         for (int i = timeout; i; i--) {
-            print("\e[2K\rBooting automatically in %u, press any key to stop the countdown...", i);
+            set_cursor_pos(0, term_rows - 1);
+            print("\e[32mBooting automatically in %u, press any key to stop the countdown...\e[0m", i);
             term_double_buffer_flush();
             if ((c = pit_sleep_and_quit_on_keypress(1))) {
                 skip_timeout = true;
tab: 248 wrap: offon