feat(win32 gui): add gui_config.json config file

This commit is contained in:
CJ van den Berg 2025-01-08 12:51:35 +01:00
parent 6d7a316abb
commit eaa7ad87b7
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
6 changed files with 40 additions and 21 deletions

View file

@ -1,4 +1,5 @@
const std = @import("std");
const root = @import("root");
const c = @cImport({
@cInclude("ResourceNames.h");
@ -10,6 +11,7 @@ const ddui = @import("ddui");
const cbor = @import("cbor");
const thespian = @import("thespian");
const vaxis = @import("vaxis");
const gui_config = @import("gui_config");
const RGB = @import("color").RGB;
const input = @import("input");
@ -381,6 +383,7 @@ fn calcWindowPlacement() WindowPlacement {
const CreateWindowArgs = struct {
allocator: std.mem.Allocator,
pid: thespian.pid,
conf: gui_config,
};
pub fn start() !std.Thread {
@ -418,9 +421,12 @@ fn entry(pid: thespian.pid) !void {
win32.GetLastError(),
);
const conf, _ = root.read_config(gui_config, arena_instance.allocator());
var create_args = CreateWindowArgs{
.allocator = arena_instance.allocator(),
.pid = pid,
.conf = conf,
};
const hwnd = win32.CreateWindowExW(
window_style_ex,