mod(container/border): change default configuration
This commit is contained in:
@@ -27,6 +27,7 @@ pub fn main() !void {
|
|||||||
.border = .{
|
.border = .{
|
||||||
.color = .blue,
|
.color = .blue,
|
||||||
.corners = .rounded,
|
.corners = .rounded,
|
||||||
|
.sides = .all(),
|
||||||
.separator = .{ .enabled = false },
|
.separator = .{ .enabled = false },
|
||||||
},
|
},
|
||||||
.layout = .{
|
.layout = .{
|
||||||
@@ -36,14 +37,12 @@ pub fn main() !void {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
try container.append(try App.Container.init(allocator, .{
|
try container.append(try App.Container.init(allocator, .{
|
||||||
.border = .{ .color = .light_blue, .corners = .squared },
|
|
||||||
.rectangle = .{ .fill = .blue },
|
.rectangle = .{ .fill = .blue },
|
||||||
}));
|
}));
|
||||||
try container.append(try App.Container.init(allocator, .{
|
try container.append(try App.Container.init(allocator, .{
|
||||||
.border = .{ .color = .light_blue, .corners = .squared },
|
.border = .{ .color = .light_blue, .corners = .squared },
|
||||||
}));
|
}));
|
||||||
try container.append(try App.Container.init(allocator, .{
|
try container.append(try App.Container.init(allocator, .{
|
||||||
.border = .{ .color = .light_blue, .corners = .squared },
|
|
||||||
.rectangle = .{ .fill = .blue },
|
.rectangle = .{ .fill = .blue },
|
||||||
}));
|
}));
|
||||||
defer container.deinit();
|
defer container.deinit();
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ pub const Border = struct {
|
|||||||
pub const rounded_border: [6]u21 = .{ '╭', '─', '╮', '│', '╰', '╯' };
|
pub const rounded_border: [6]u21 = .{ '╭', '─', '╮', '│', '╰', '╯' };
|
||||||
pub const squared_border: [6]u21 = .{ '┌', '─', '┐', '│', '└', '┘' };
|
pub const squared_border: [6]u21 = .{ '┌', '─', '┐', '│', '└', '┘' };
|
||||||
/// Color to use for the border
|
/// Color to use for the border
|
||||||
color: Color = .white,
|
color: Color = .default,
|
||||||
/// Configure the corner type to be used for the border
|
/// Configure the corner type to be used for the border
|
||||||
corners: enum(u1) {
|
corners: enum(u1) {
|
||||||
squared,
|
squared,
|
||||||
@@ -22,10 +22,14 @@ pub const Border = struct {
|
|||||||
} = .squared,
|
} = .squared,
|
||||||
/// Configure the sides where the borders shall be rendered
|
/// Configure the sides where the borders shall be rendered
|
||||||
sides: packed struct {
|
sides: packed struct {
|
||||||
top: bool = true,
|
top: bool = false,
|
||||||
bottom: bool = true,
|
bottom: bool = false,
|
||||||
left: bool = true,
|
left: bool = false,
|
||||||
right: bool = true,
|
right: bool = false,
|
||||||
|
|
||||||
|
pub fn all() @This() {
|
||||||
|
return .{ .top = true, .bottom = true, .left = true, .right = true };
|
||||||
|
}
|
||||||
} = .{},
|
} = .{},
|
||||||
/// Configure separator borders between child element to added to the layout
|
/// Configure separator borders between child element to added to the layout
|
||||||
separator: struct {
|
separator: struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user