mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-21 13:04:20 +02:00
No more lids
This commit is contained in:
parent
7d42254ee5
commit
3c54c1613a
3 changed files with 22 additions and 16 deletions
24
src/main.zig
24
src/main.zig
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue