Considering the fact that when I started Zterm there were no #zig bindings to gtk+ there was a lot more cleanup to do in the code when I have it a critical look than I really expected. The results will hopefully be worth the effort.
Work is progressing on the gradient branch of Zterm. The gradient editor tab of the preferences window is mocked up and the controls are shown or hid depending on which ones are context appropriate. Just need to use the widget states to generate some css and apply it to the preview window whenever a control is changed, then apply the same css as the terminal background when the dialog is closed. #zig #zterm
I've been wanting to get this done for some time, but I'm lazy...
Github's new AI plans sort of got my motivation up. Now, to try to get Gitea support in the Gyro package manager for #zig
Zig tip of the week: a twofer, this function demonstrates using comptime to create generics as well as retrieving an enum field from a string.
fn parse_enum(comptime T: type, style: []const u8) ?T {
inline for (std.meta.fields(T)) |field| {
if (std.mem.eql(u8, style[0..len], field.name)) {
return @field(T, field.name);
}
}
return null;
}
#zig #programming
#zig tip of the week.
Return a value from an arbitrary block of code with a named block:
const red = if (condition) blk: {
if (othercond) {
break :blk "rgb(255,0,0)";
} else {
break :blk "rgb(240,25,25)";
}
} else null;