deps: update zenolith
This commit is contained in:
parent
788a38fb45
commit
f0b5f244af
|
@ -10,8 +10,8 @@
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.zenolith = .{
|
.zenolith = .{
|
||||||
//.path = "../zenolith",
|
//.path = "../zenolith",
|
||||||
.url = "git+https://git.mzte.de/zenolith/zenolith.git#ad388687cd205079aab75074a542eadc79490df7",
|
.url = "git+https://git.mzte.de/zenolith/zenolith.git#c4ae23938d9f64ffd8dd0662314f7b478818547a",
|
||||||
.hash = "12201677a81b6f8133bbe9c7d3b2afc07b61bf632a070d13d57f995827022f6a1f54",
|
.hash = "1220aa2f21fb19b4cb741e0709e84308a4d079f446dd655827206b0f834da8efa350",
|
||||||
},
|
},
|
||||||
|
|
||||||
.sdl2 = .{
|
.sdl2 = .{
|
||||||
|
|
|
@ -96,21 +96,7 @@ pub fn run(
|
||||||
) anyerror!void {
|
) anyerror!void {
|
||||||
// Initial layout pass before we get a resize event.
|
// Initial layout pass before we get a resize event.
|
||||||
if (self.initial_run) {
|
if (self.initial_run) {
|
||||||
var width: c_int = 0;
|
try self.relayoutRoot(root);
|
||||||
var height: c_int = 0;
|
|
||||||
c.SDL_GetWindowSize(self.window, &width, &height);
|
|
||||||
|
|
||||||
try zenolith.treevent.fire(root, zenolith.treevent.LayoutSize{
|
|
||||||
.final = true,
|
|
||||||
.constraints = .{
|
|
||||||
.min = .{ .width = 0, .height = 0 },
|
|
||||||
.max = .{ .width = @intCast(width), .height = @intCast(height) },
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
try zenolith.treevent.fire(root, zenolith.treevent.LayoutPosition{
|
|
||||||
.position = .{ .x = 0, .y = 0 },
|
|
||||||
});
|
|
||||||
|
|
||||||
self.initial_run = false;
|
self.initial_run = false;
|
||||||
}
|
}
|
||||||
|
@ -160,13 +146,13 @@ pub fn run(
|
||||||
try zenolith.treevent.fire(root, zenolith.treevent.LayoutSize{
|
try zenolith.treevent.fire(root, zenolith.treevent.LayoutSize{
|
||||||
.final = true,
|
.final = true,
|
||||||
.constraints = .{
|
.constraints = .{
|
||||||
.min = .{ .width = 0, .height = 0 },
|
.min = zenolith.layout.Size.zero,
|
||||||
.max = size,
|
.max = size,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
try zenolith.treevent.fire(root, zenolith.treevent.LayoutPosition{
|
try zenolith.treevent.fire(root, zenolith.treevent.LayoutPosition{
|
||||||
.position = .{ .x = 0, .y = 0 },
|
.position = zenolith.layout.Position.zero,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
else => {},
|
else => {},
|
||||||
|
@ -392,3 +378,21 @@ pub fn createFont(self: Sdl2Platform, opts: CreateFontOptions) CreateFontError!S
|
||||||
.pixel_buf = std.ArrayList(u8).init(self.alloc),
|
.pixel_buf = std.ArrayList(u8).init(self.alloc),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn relayoutRoot(self: *Sdl2Platform, root: *zenolith.widget.Widget) !void {
|
||||||
|
var width: c_int = 0;
|
||||||
|
var height: c_int = 0;
|
||||||
|
c.SDL_GetWindowSize(self.window, &width, &height);
|
||||||
|
|
||||||
|
try zenolith.treevent.fire(root, zenolith.treevent.LayoutSize{
|
||||||
|
.final = true,
|
||||||
|
.constraints = .{
|
||||||
|
.min = .{ .width = 0, .height = 0 },
|
||||||
|
.max = .{ .width = @intCast(width), .height = @intCast(height) },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
try zenolith.treevent.fire(root, zenolith.treevent.LayoutPosition{
|
||||||
|
.position = .{ .x = 0, .y = 0 },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue