add(event): mouse event has relative position for receiving elements
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Has been cancelled
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Has been cancelled
This commit is contained in:
@@ -87,15 +87,54 @@ pub fn main() !void {
|
||||
}, quit_text.element());
|
||||
try container.append(try App.Container.init(allocator, .{}, scrollable.element()));
|
||||
|
||||
try container.append(try App.Container.init(allocator, .{
|
||||
var nested_container: App.Container = try .init(allocator, .{
|
||||
.layout = .{
|
||||
.direction = .vertical,
|
||||
.separator = .{
|
||||
.enabled = true,
|
||||
},
|
||||
},
|
||||
}, .{});
|
||||
var inner_container: App.Container = try .init(allocator, .{
|
||||
.layout = .{
|
||||
.direction = .vertical,
|
||||
},
|
||||
.border = .{
|
||||
.color = .light_blue,
|
||||
.sides = .all,
|
||||
},
|
||||
}, .{});
|
||||
try inner_container.append(try .init(allocator, .{
|
||||
.rectangle = .{
|
||||
.fill = .blue,
|
||||
},
|
||||
.size = .{
|
||||
.dim = .{ .x = 100 },
|
||||
.grow = .horizontal,
|
||||
.dim = .{ .y = 5 },
|
||||
},
|
||||
}, .{}));
|
||||
try inner_container.append(try .init(allocator, .{
|
||||
.rectangle = .{
|
||||
.fill = .red,
|
||||
},
|
||||
.size = .{
|
||||
.grow = .horizontal,
|
||||
.dim = .{ .y = 5 },
|
||||
},
|
||||
}, .{}));
|
||||
try inner_container.append(try .init(allocator, .{
|
||||
.rectangle = .{
|
||||
.fill = .green,
|
||||
},
|
||||
}, .{}));
|
||||
try nested_container.append(inner_container);
|
||||
try nested_container.append(try .init(allocator, .{
|
||||
.size = .{
|
||||
.grow = .horizontal,
|
||||
.dim = .{ .y = 1 },
|
||||
},
|
||||
}, .{}));
|
||||
try container.append(nested_container);
|
||||
try container.append(try App.Container.init(allocator, .{
|
||||
.rectangle = .{ .fill = .blue },
|
||||
.size = .{
|
||||
|
||||
Reference in New Issue
Block a user