mirror of
https://github.com/nicbarker/clay.git
synced 2026-02-06 12:48:49 +00:00
Continuing example and still working on adaption the CLAY macro
This commit is contained in:
parent
e9522005db
commit
b7e1d69ca6
3 changed files with 108 additions and 9 deletions
|
|
@ -76,18 +76,57 @@ main :: () {
|
|||
};
|
||||
|
||||
Clay.BeginLayout();
|
||||
if Clay.UI(
|
||||
Clay.UI(
|
||||
Clay.ID("OuterContainer"),
|
||||
Clay.Rectangle(.{color = .{43, 41, 51, 255}}),
|
||||
Clay.Layout(.{
|
||||
layoutDirection = .TOP_TO_BOTTOM,
|
||||
sizing = layout_expand,
|
||||
padding = .{16, 16},
|
||||
childGap = 16,
|
||||
}),
|
||||
Clay.Rectangle(.{color = .{43, 41, 51, 255}})
|
||||
) {
|
||||
children = #code {
|
||||
Clay.UI(
|
||||
Clay.ID("HeaderBar"),
|
||||
Clay.Rectangle(content_background_config),
|
||||
Clay.Layout(.{
|
||||
sizing = .{
|
||||
height = Clay.SizingFixed(60),
|
||||
width = Clay.SizingGrow(),
|
||||
},
|
||||
padding = .{16, 16},
|
||||
childGap = 16,
|
||||
childAlignment = .{
|
||||
y = .CENTER,
|
||||
}
|
||||
}),
|
||||
children = #code {
|
||||
Clay.UI(
|
||||
Clay.ID("FileButton"),
|
||||
Clay.Layout(.{padding = .{16, 8}}),
|
||||
Clay.Rectangle(.{
|
||||
color = .{140, 140, 140, 255},
|
||||
cornerRadius = .{5, 5, 5, 5},
|
||||
}),
|
||||
children = #code {
|
||||
Clay.Text("File", Clay.TextConfig(.{
|
||||
fontId = FONT_ID_BODY_16,
|
||||
fontSize = 16,
|
||||
textColor = Clay.Color.{255, 255, 255, 255},
|
||||
}));
|
||||
|
||||
}
|
||||
file_menu_visible := Clay.PointerOver(Clay.GetElementId("FileButton")) ||
|
||||
Clay.PointerOver(Clay.GetElementId("FileMenu"));
|
||||
|
||||
if file_menu_visible {
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
render_commands := Clay.EndLayout();
|
||||
|
||||
|
|
|
|||
21
bindings/jai/examples/introducing_clay_video_demo/test.jai
Normal file
21
bindings/jai/examples/introducing_clay_video_demo/test.jai
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#import "Basic";
|
||||
|
||||
|
||||
test :: () -> bool #must #expand {
|
||||
print("one\n");
|
||||
|
||||
`defer print("two\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
main :: () {
|
||||
print("ichi\n");
|
||||
if test() {
|
||||
print("ni\n");
|
||||
if test() {
|
||||
print("san\n");
|
||||
}
|
||||
}
|
||||
print("yon\n");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue