mirror of
https://github.com/nicbarker/clay.git
synced 2025-01-23 01:46:02 +00:00
Compare commits
5 Commits
14083db747
...
40ca3a379b
Author | SHA1 | Date | |
---|---|---|---|
|
40ca3a379b | ||
|
9b2d585499 | ||
|
81589ad29b | ||
|
16f894bb4d | ||
|
9f07f5aac8 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9
clay.h
9
clay.h
@ -2257,12 +2257,6 @@ void Clay__SizeContainersAlongAxis(bool xAxis) {
|
||||
*childSize = (parentSize - totalPaddingAndChildGaps) * childSizing.size.percent;
|
||||
if (sizingAlongAxis) {
|
||||
innerContentSize += *childSize;
|
||||
if (childOffset > 0) {
|
||||
innerContentSize += parentChildGap; // For children after index 0, the childAxisOffset is the gap from the previous child
|
||||
totalPaddingAndChildGaps += parentChildGap;
|
||||
}
|
||||
} else {
|
||||
innerContentSize = CLAY__MAX(*childSize, innerContentSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2483,9 +2477,6 @@ void Clay__CalculateFinalLayout() {
|
||||
|
||||
// DFS node has been visited, this is on the way back up to the root
|
||||
Clay_LayoutConfig *layoutConfig = currentElement->layoutConfig;
|
||||
if (layoutConfig->sizing.height.type == CLAY__SIZING_TYPE_PERCENT) {
|
||||
continue;
|
||||
}
|
||||
if (layoutConfig->layoutDirection == CLAY_LEFT_TO_RIGHT) {
|
||||
// Resize any parent containers that have grown in height along their non layout axis
|
||||
for (int32_t j = 0; j < currentElement->childrenOrTextContent.children.length; ++j) {
|
||||
|
Binary file not shown.
@ -117,7 +117,7 @@ int main(void) {
|
||||
|
||||
Clay_RectangleElementConfig contentBackgroundConfig = {
|
||||
.color = { 90, 90, 90, 255 },
|
||||
.cornerRadius = 8
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(8)
|
||||
};
|
||||
|
||||
Clay_BeginLayout();
|
||||
@ -141,7 +141,7 @@ int main(void) {
|
||||
.height = CLAY_SIZING_FIXED(60),
|
||||
.width = CLAY_SIZING_GROW(0)
|
||||
},
|
||||
.padding = { 16 },
|
||||
.padding = { 16, 16, 0, 0 },
|
||||
.childGap = 16,
|
||||
.childAlignment = {
|
||||
.y = CLAY_ALIGN_Y_CENTER
|
||||
@ -151,10 +151,10 @@ int main(void) {
|
||||
// Header buttons go here
|
||||
CLAY(
|
||||
CLAY_ID("FileButton"),
|
||||
CLAY_LAYOUT({ .padding = { 16, 8 }}),
|
||||
CLAY_LAYOUT({ .padding = { 16, 16, 8, 8 }}),
|
||||
CLAY_RECTANGLE({
|
||||
.color = { 140, 140, 140, 255 },
|
||||
.cornerRadius = 5
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(5)
|
||||
})
|
||||
) {
|
||||
CLAY_TEXT(CLAY_STRING("File"), CLAY_TEXT_CONFIG({
|
||||
@ -177,7 +177,7 @@ int main(void) {
|
||||
},
|
||||
}),
|
||||
CLAY_LAYOUT({
|
||||
.padding = {0, 8 }
|
||||
.padding = {0, 0, 8, 8 }
|
||||
})
|
||||
) {
|
||||
CLAY(
|
||||
@ -189,7 +189,7 @@ int main(void) {
|
||||
}),
|
||||
CLAY_RECTANGLE({
|
||||
.color = { 40, 40, 40, 255 },
|
||||
.cornerRadius = 8
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(8)
|
||||
})
|
||||
) {
|
||||
// Render dropdown items here
|
||||
@ -236,7 +236,7 @@ int main(void) {
|
||||
CLAY_LAYOUT(sidebarButtonLayout),
|
||||
CLAY_RECTANGLE({
|
||||
.color = { 120, 120, 120, 255 },
|
||||
.cornerRadius = 8,
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(8),
|
||||
})
|
||||
) {
|
||||
CLAY_TEXT(document.title, CLAY_TEXT_CONFIG({
|
||||
@ -252,7 +252,7 @@ int main(void) {
|
||||
Clay_Hovered()
|
||||
? CLAY_RECTANGLE({
|
||||
.color = { 120, 120, 120, 120 },
|
||||
.cornerRadius = 8
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(8)
|
||||
})
|
||||
: 0
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user