:: commit 8a40112fe43966d2f5db7971daf30ce9e5bd2683

mintsuki <mintsuki@protonmail.com> — 2020-12-18 22:01

parents: 373be351df

menu: Small cosmetic changes to textbox

diff --git a/limine-pxe.bin b/limine-pxe.bin
index 18a75535..c710cd03 100644
Binary files a/limine-pxe.bin and b/limine-pxe.bin differ
diff --git a/limine.bin b/limine.bin
index c4b77ae9..2e5a0cc9 100644
Binary files a/limine.bin and b/limine.bin differ
diff --git a/stage2.map b/stage2.map
index 69a32858..ae2c2678 100644
Binary files a/stage2.map and b/stage2.map differ
diff --git a/stage2/menu.c b/stage2/menu.c
index d6f8bcca..0c976933 100644
--- a/stage2/menu.c
+++ b/stage2/menu.c
@@ -72,7 +72,7 @@ static size_t get_prev_line(size_t index, const char *buffer) {
 static char *config_entry_editor(const char *orig_entry) {
     size_t cursor_offset = 0;
     size_t entry_size    = strlen(orig_entry);
-    size_t window_size   = term_rows - 12;
+    size_t window_size   = term_rows - 11;
     size_t window_offset = 0;
 
     // Skip leading newlines
@@ -97,8 +97,18 @@ refresh:
     print("Press esc to return to main menu and discard changes, press F10 to boot.\n");
 
     print("\n\xda");
-    for (int i = 0; i < term_cols - 2; i++)
-        print("\xc4");
+    for (int i = 0; i < term_cols - 2; i++) {
+        switch (i) {
+            case 1: case 2: case 3:
+                if (window_offset > 0) {
+                    print("\x18");
+                    break;
+                }
+                // FALLTHRU
+            default:
+                print("\xc4");
+        }
+    }
     print("\xbf\xb3");
 
     int cursor_x, cursor_y;
@@ -166,8 +176,18 @@ refresh:
         print("\xb3\xc0");
     }
 
-    for (int i = 0; i < term_cols - 2; i++)
-        print("\xc4");
+    for (int i = 0; i < term_cols - 2; i++) {
+        switch (i) {
+            case 1: case 2: case 3:
+                if (current_line - window_offset >= window_size) {
+                    print("\x19");
+                    break;
+                }
+                // FALLTHRU
+            default:
+                print("\xc4");
+        }
+    }
     print("\xd9");
 
     // Hack to redraw the cursor
tab: 248 wrap: offon