feat: added sidebars
This commit is contained in:
parent
f8dc3d3bee
commit
740fbb22cd
|
@ -3,12 +3,12 @@
|
|||
|
||||
bool static sidebar_open = true;
|
||||
|
||||
Clay_Color const SIDEBAR_COLOR = {120.f, 120.f, 120.f, 255.f};
|
||||
Clay_Color const SIDEBAR_COLOR = {80.f, 80.f, 80.f, 255.f};
|
||||
|
||||
Clay_LayoutConfig const SIDEBAR_LAYOUT = {
|
||||
.sizing={
|
||||
.height=CLAY_SIZING_GROW(),
|
||||
.width=CLAY_SIZING_FIXED(300)
|
||||
.width=CLAY_SIZING_FIXED(400)
|
||||
},
|
||||
.layoutDirection=CLAY_TOP_TO_BOTTOM
|
||||
};
|
||||
|
@ -19,31 +19,45 @@ Clay_RectangleElementConfig const SIDEBAR_RECTANGLE = {
|
|||
|
||||
static
|
||||
void render_composit_library_sidebar() {
|
||||
CLAY(CLAY_ID("Sidebar"),
|
||||
CLAY_LAYOUT(SIDEBAR_LAYOUT),
|
||||
CLAY_RECTANGLE(SIDEBAR_RECTANGLE)
|
||||
) {
|
||||
if(sidebar_open) {
|
||||
CLAY(CLAY_ID("Sidebar"),
|
||||
CLAY_LAYOUT(SIDEBAR_LAYOUT),
|
||||
CLAY_RECTANGLE(SIDEBAR_RECTANGLE)
|
||||
) {
|
||||
CLAY(CLAY_ID("SidebarTab"),
|
||||
CLAY_FLOATING({
|
||||
.attachment={
|
||||
.element=CLAY_ATTACH_POINT_LEFT_TOP,
|
||||
.parent=CLAY_ATTACH_POINT_RIGHT_TOP
|
||||
}
|
||||
}),
|
||||
CLAY_LAYOUT({
|
||||
.sizing={.width=CLAY_SIZING_FIXED(20), .height=CLAY_SIZING_FIXED(50)},
|
||||
}),
|
||||
CLAY_RECTANGLE({
|
||||
.color=SIDEBAR_COLOR,
|
||||
.cornerRadius={
|
||||
.topRight=6,
|
||||
.bottomRight=6,
|
||||
.topLeft=0,
|
||||
.bottomLeft=0
|
||||
}
|
||||
})
|
||||
) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CLAY(CLAY_ID("SidebarTab"),
|
||||
CLAY_FLOATING({
|
||||
.attachment={
|
||||
.element=CLAY_ATTACH_POINT_LEFT_TOP,
|
||||
.parent=CLAY_ATTACH_POINT_RIGHT_TOP
|
||||
.parent=CLAY_ATTACH_POINT_LEFT_TOP
|
||||
}
|
||||
}),
|
||||
CLAY_LAYOUT({
|
||||
.sizing={.width=CLAY_SIZING_FIXED(10), .height=CLAY_SIZING_FIXED(40)},
|
||||
}),
|
||||
CLAY_RECTANGLE({
|
||||
.color=SIDEBAR_COLOR,
|
||||
.cornerRadius={
|
||||
.topRight=16,
|
||||
.bottomRight=16,
|
||||
.topLeft=16,
|
||||
.bottomLeft=16
|
||||
}
|
||||
.color=SIDEBAR_COLOR
|
||||
})
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue