From 1930323f992bad6f54506a1ba2d698bd97dc5b14 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Sat, 27 Nov 2021 17:05:35 +0300 Subject: panel: make set_cwd() --- Library/UefiShellUfmCommandLib/panel.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Library/UefiShellUfmCommandLib/panel.c b/Library/UefiShellUfmCommandLib/panel.c index 66f3b13..39439fc 100644 --- a/Library/UefiShellUfmCommandLib/panel.c +++ b/Library/UefiShellUfmCommandLib/panel.c @@ -14,6 +14,22 @@ #define SIZE_COLS 7 #define MODIFYTIME_COLS 12 +STATIC VOID set_cwd(struct panel_ctx *p, CONST CHAR16 *path) +{ + if(p->cwd) { + FreePool(p->cwd); + p->cwd = NULL; + } + if(path) + StrnCatGrow(&p->cwd, NULL, path, 0); + + mvwhline(p->wcwd, 0, 0, BOXDRAW_HORIZONTAL, p->wcwd->width); + wattrset(p->wcwd, EFI_TEXT_ATTR(EFI_WHITE, EFI_BLACK)); + mvwprintf(p->wcwd, 0, 0, L" %s ", p->cwd ? p->cwd : L" "); + wattroff(p->wcwd); + wrefresh(p->wcwd); +} + struct panel_ctx *panel_alloc(struct screen *scr, CONST CHAR16 *path, INT32 cols, INT32 lines, INT32 x, INT32 y) { -- cgit v1.2.3-18-g5258