From dbe8bd817e2db2294976457b1c272b6025ae3b61 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Wed, 1 Dec 2021 19:23:01 +0300 Subject: panel: make panel_mark_file() --- Library/UefiShellUfmCommandLib/panel.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Library/UefiShellUfmCommandLib/panel.c') diff --git a/Library/UefiShellUfmCommandLib/panel.c b/Library/UefiShellUfmCommandLib/panel.c index 450d73b..6ee1939 100644 --- a/Library/UefiShellUfmCommandLib/panel.c +++ b/Library/UefiShellUfmCommandLib/panel.c @@ -335,3 +335,25 @@ BOOLEAN panel_cd_to(struct panel_ctx *p, CONST CHAR16 *path) return TRUE; } +BOOLEAN panel_mark_file(struct panel_ctx *p, UINTN line) +{ + UINTN idx = line - 1; + + if(!p->cwd) // we can mark only files + return FALSE; + + if(p->dirs->marked[idx]) { + UNHIGHLIGHT_LINE_AS_MARK(p, line); + p->marked--; + } + else { + HIGHLIGHT_LINE_AS_MARK(p, line); + p->marked++; + } + + p->dirs->marked[idx] = !p->dirs->marked[idx]; + update_marked_info(p); + wrefresh(p->wlist); + return TRUE; +} + -- cgit v1.2.3-18-g5258