feat(render): implement direct rendering
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 38s

This commit is contained in:
2024-11-10 19:08:38 +01:00
parent 35a7f9cc02
commit 67a535db6d
5 changed files with 93 additions and 32 deletions

View File

@@ -3,7 +3,7 @@ const zterm = @import("zterm");
const App = zterm.App(
union(enum) {},
zterm.Renderer.Plain,
zterm.Renderer.Direct,
true,
);
const Key = zterm.Key;
@@ -31,7 +31,7 @@ pub fn main() !void {
// -> size hint how much should it use?
var layout = Layout.createFrom(layout: {
var vstack = Layout.VStack.init(allocator, .{
var vstack = Layout.HStack.init(allocator, .{
Widget.createFrom(blk: {
const file = try std.fs.cwd().openFile("./src/app.zig", .{});
defer file.close();
@@ -59,6 +59,7 @@ pub fn main() !void {
// App.Event loop
while (true) {
const event = app.nextEvent();
log.debug("received event: {s}", .{@tagName(event)});
switch (event) {
.quit => break,