aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-11-27 17:05:35 +0300
committerJoursoir <chat@joursoir.net>2021-11-27 17:05:35 +0300
commit1930323f992bad6f54506a1ba2d698bd97dc5b14 (patch)
treed601728244d9a77ac0c962443266e915057eafa2 /Library
parentd5212c2a4b474f65ea232ca0f29517dcc7e76941 (diff)
downloadufm-1930323f992bad6f54506a1ba2d698bd97dc5b14.tar.gz
ufm-1930323f992bad6f54506a1ba2d698bd97dc5b14.tar.bz2
ufm-1930323f992bad6f54506a1ba2d698bd97dc5b14.zip
panel: make set_cwd()
Diffstat (limited to 'Library')
-rw-r--r--Library/UefiShellUfmCommandLib/panel.c16
1 files changed, 16 insertions, 0 deletions
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)
{