feat: add build version to home screen

This commit is contained in:
CJ van den Berg 2025-03-26 19:09:49 +01:00
parent b410687339
commit 4283321542
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 28 additions and 6 deletions

View file

@ -15,6 +15,7 @@ const c = @cImport({
const build_options = @import("build_options");
const log = @import("log");
pub const version = @embedFile("version");
pub const version_info = @embedFile("version_info");
pub var max_diff_lines: usize = 50000;

View file

@ -300,8 +300,15 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
const x = @min(self.plane.dim_x() -| 32, 8);
self.position_menu(self.v_center(5, self.menu_len, 5), self.center(x, self.menu_w));
}
const more = self.menu.render(theme);
self.plane.cursor_move_yx(
@intCast(self.plane.dim_y() - 2),
@intCast(@max(self.plane.dim_x(), root.version.len + 3) - root.version.len - 3),
) catch {};
self.plane.set_style_bg_transparent(style_subtext);
_ = self.plane.print("{s}", .{root.version}) catch return false;
const more = self.menu.render(theme);
return more or self.fire != null;
}