Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to hide help text #292

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Limine interface control options.
* `INTERFACE_BRANDING` - A string that will be displayed on top of the Limine interface.
* `INTERFACE_BRANDING_COLOUR` - A value between 0 and 7 specifying the colour of the branding string. Default is cyan (6).
* `INTERFACE_BRANDING_COLOR` - Alias of `INTERFACE_BRANDING_COLOUR`.
* `INTERFACE_HELP_HIDDEN` - Hides the help text located at the top of the screen showing the key bindings.

Limine graphical terminal control options. They are ignored if using text mode.

Expand Down
1 change: 1 addition & 0 deletions common/lib/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ UINT32 efi_desc_ver = 0;
#endif

bool editor_enabled = true;
bool help_hidden = false;

bool parse_resolution(size_t *width, size_t *height, size_t *bpp, const char *buf) {
size_t res[3] = {0};
Expand Down
2 changes: 1 addition & 1 deletion common/lib/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern struct volume *boot_volume;
extern bool stage3_loaded;
#endif

extern bool quiet, serial, editor_enabled, hash_mismatch_panic;
extern bool quiet, serial, editor_enabled, help_hidden, hash_mismatch_panic;

bool parse_resolution(size_t *width, size_t *height, size_t *bpp, const char *buf);

Expand Down
23 changes: 15 additions & 8 deletions common/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,11 @@ noreturn void _menu(bool first_run) {
editor_enabled = strcmp(editor_enabled_str, "yes") == 0;
}

char *help_hidden_str = config_get_value(NULL, 0, "INTERFACE_HELP_HIDDEN");
if (help_hidden_str != NULL) {
help_hidden = strcmp(help_hidden_str, "yes") == 0;
}

menu_branding = config_get_value(NULL, 0, "INTERFACE_BRANDING");
if (menu_branding == NULL)
menu_branding = "Limine " LIMINE_VERSION;
Expand Down Expand Up @@ -805,15 +810,17 @@ noreturn void _menu(bool first_run) {
print(serial ? "vvv" : "↓↓↓");
}

set_cursor_pos_helper(0, 3);
if (editor_enabled && selected_menu_entry->sub == NULL) {
print(" \e[32mARROWS\e[0m Select \e[32mENTER\e[0m Boot \e[32mE\e[0m Edit");
} else {
print(" \e[32mARROWS\e[0m Select \e[32mENTER\e[0m %s",
selected_menu_entry->expanded ? "Collapse" : "Expand");
if (!help_hidden) {
set_cursor_pos_helper(0, 3);
if (editor_enabled && selected_menu_entry->sub == NULL) {
print(" \e[32mARROWS\e[0m Select \e[32mENTER\e[0m Boot \e[32mE\e[0m Edit");
} else {
print(" \e[32mARROWS\e[0m Select \e[32mENTER\e[0m %s",
selected_menu_entry->expanded ? "Collapse" : "Expand");
}
set_cursor_pos_helper(terms[0]->cols - 13, 3);
print("\e[32mC\e[0m Console");
}
set_cursor_pos_helper(terms[0]->cols - 13, 3);
print("\e[32mC\e[0m Console");
set_cursor_pos_helper(x, y);
}

Expand Down