From 6a7926acb843acfe2949df68d9fe9f2ee8a73516 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Wed, 1 Dec 2021 19:24:26 +0300 Subject: panel: make panel_set_active() --- Library/UefiShellUfmCommandLib/panel.c | 11 +++++++++++ Library/UefiShellUfmCommandLib/panel.h | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/Library/UefiShellUfmCommandLib/panel.c b/Library/UefiShellUfmCommandLib/panel.c index 6ee1939..f920ea1 100644 --- a/Library/UefiShellUfmCommandLib/panel.c +++ b/Library/UefiShellUfmCommandLib/panel.c @@ -276,6 +276,7 @@ VOID panel_release(struct panel_ctx *p) FreePool(p); } + BOOLEAN panel_move_cursor(struct panel_ctx *p, UINTN line) { UINTN oldline = p->curline; @@ -335,6 +336,16 @@ BOOLEAN panel_cd_to(struct panel_ctx *p, CONST CHAR16 *path) return TRUE; } +VOID panel_set_active(struct panel_ctx *p, BOOLEAN flag) +{ + if(flag == TRUE) { + HIGHLIGHT_LINE_AS_CURRENT(p, p->curline); + return; + } + + UNHIGHLIGHT_LINE_AS_CURRENT(p, p->curline); +} + BOOLEAN panel_mark_file(struct panel_ctx *p, UINTN line) { UINTN idx = line - 1; diff --git a/Library/UefiShellUfmCommandLib/panel.h b/Library/UefiShellUfmCommandLib/panel.h index 8fdb19f..8670f82 100644 --- a/Library/UefiShellUfmCommandLib/panel.h +++ b/Library/UefiShellUfmCommandLib/panel.h @@ -70,6 +70,17 @@ BOOLEAN panel_move_cursor(struct panel_ctx *p, UINTN line); */ BOOLEAN panel_cd_to(struct panel_ctx *p, CONST CHAR16 *path); +/* + * Changes the active state + * + * p: the panel on which to operate + * active: TRUE if the panel should be activated. FALSE if the + * panel should be disabled + * + * return: VOID +*/ +VOID panel_set_active(struct panel_ctx *p, BOOLEAN active); + /* * Marks the file as selected. Supports work only with files. * -- cgit v1.2.3-18-g5258