No more lids

This commit is contained in:
RadsammyT 2026-03-21 11:08:00 -04:00
commit 3c54c1613a
No known key found for this signature in database
3 changed files with 22 additions and 16 deletions

View file

@ -75,6 +75,7 @@ const CustomInfoLabel = struct {
lbl: Label
};
const UiState = struct {
allocator: Allocator,
auth_fails: u64,
@ -1084,19 +1085,20 @@ pub fn main() !void {
var lblIter = custom.labels.iterator();
while (lblIter.next()) |i| {
const w = Label.init("",
null,
state.buffer.fg,
state.buffer.bg,
&updateCustomInfo,
null,
);
i.value_ptr.id = w.lid;
i.value_ptr.counter = 2;
try state.custom_info.append(state.allocator, .{
.info = i.value_ptr.*,
.lbl = w
.lbl = .init(
"",
null,
state.buffer.fg,
state.buffer.bg,
&updateCustomInfo,
null
)
});
var latest = &state.custom_info.items[state.custom_info.items.len-1];
latest.info.id = latest.lbl.widget().id;
latest.info.counter = 2;
}
defer {
for (state.custom_info.items) |*item| {
@ -1763,7 +1765,7 @@ fn updateClock(self: *Label, ptr: *anyopaque) !void {
fn updateCustomInfo(lbl: *Label, ptr: *anyopaque) !void {
const state: *UiState = @ptrCast(@alignCast(ptr));
const wid = lbl.lid;
const wid = lbl.widget().id;
var stdout = std.ArrayList(u8).empty;
defer stdout.deinit(state.allocator);
var stderr = std.ArrayList(u8).empty;