From a1ce5957d152b2589889f55fe4197b6abf0c75f6 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Mon, 30 Jan 2023 16:06:46 +0100 Subject: [PATCH] use simple list renderer in HomeContext --- src/lib/HomeContext.hx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib/HomeContext.hx b/src/lib/HomeContext.hx index 5a0cf67..ee81d26 100644 --- a/src/lib/HomeContext.hx +++ b/src/lib/HomeContext.hx @@ -1,5 +1,6 @@ package lib; +import lib.ui.rendere.List; import kernel.KernelEvents; import bin.Terminal; import kernel.ui.WindowManager; @@ -93,13 +94,9 @@ class HomeContext { ctx.clear(); ctx.setCursorPos(0,0); - for(i in 0...MAX_CONTEXT){ - ctx.setCursorPos(0,i); - if (workspaces.exists(i)) { - ctx.write("Switch to context " + i); - }else{ - ctx.write("Create new Terminal on context " + i); - } - } + var list = [for (i in 0...MAX_CONTEXT) workspaces.exists(i) ? 'Switch to context ${i}' : 'Create new Terminal on context ${i}']; + var listRenderer = new List(); + + listRenderer.render(list).renderToContext(ctx); } }