feat: added more containers
This commit is contained in:
parent
0ee1962a16
commit
04a612e0c1
|
@ -1,62 +1,77 @@
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
|
|
||||||
#include "defs.h"
|
|
||||||
#include "style.h"
|
#include "style.h"
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <clay/clay.h>
|
#include <clay/clay.h>
|
||||||
|
|
||||||
static inline
|
static inline void DiceSelectorContainer() {
|
||||||
void DiceContainer() {
|
CLAY(CLAY_ID("DiceSelector"), {
|
||||||
CLAY(CLAY_ID("DiceContainer"), {
|
|
||||||
.layout = {
|
.layout = {
|
||||||
.sizing = { CLAY_SIZING_GROW(0), CLAY_SIZING_PERCENT(0.2) },
|
.layoutDirection = CLAY_TOP_TO_BOTTOM,
|
||||||
.padding = CLAY_PADDING_ALL(16),
|
.sizing = { CLAY_SIZING_FIXED(300), CLAY_SIZING_GROW(0) },
|
||||||
|
.padding = containerPadding,
|
||||||
|
.childGap = paragraphGap,
|
||||||
},
|
},
|
||||||
.backgroundColor = containerColors[0],
|
.INNER_CONTAINER(0)
|
||||||
.cornerRadius = defaultRadiusAll,
|
|
||||||
}) {
|
}) {
|
||||||
CLAY_TEXT(CLAY_STRING("Text data"), CLAY_TEXT_CONFIG({
|
}
|
||||||
TEXT_BODY,
|
}
|
||||||
.textColor = textColors[0]
|
|
||||||
|
static inline void ActiveDiceContainer() {
|
||||||
|
CLAY(CLAY_ID("ActiveDice"), {
|
||||||
|
.layout = {
|
||||||
|
.layoutDirection = CLAY_TOP_TO_BOTTOM,
|
||||||
|
.sizing = { CLAY_SIZING_GROW(0), CLAY_SIZING_GROW(0) },
|
||||||
|
.padding = containerPadding,
|
||||||
|
.childGap = paragraphGap,
|
||||||
|
},
|
||||||
|
.INNER_CONTAINER(0)
|
||||||
|
}) {
|
||||||
|
CLAY_TEXT(CLAY_STRING("Header Text"), CLAY_TEXT_CONFIG({
|
||||||
|
.H(1, 0),
|
||||||
|
}));
|
||||||
|
CLAY_TEXT(CLAY_STRING("Content text"), CLAY_TEXT_CONFIG({
|
||||||
|
.BODY(0),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
static inline void DiceContainer() {
|
||||||
void DiceLogContainer() {
|
CLAY(CLAY_ID("DiceContainer"), {
|
||||||
|
.layout = {
|
||||||
|
.layoutDirection = CLAY_LEFT_TO_RIGHT,
|
||||||
|
.sizing = { CLAY_SIZING_GROW(0), CLAY_SIZING_PERCENT(0.4) },
|
||||||
|
.childGap = containerGap
|
||||||
|
},
|
||||||
|
}) {
|
||||||
|
DiceSelectorContainer();
|
||||||
|
ActiveDiceContainer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void DiceLogContainer() {
|
||||||
CLAY(CLAY_ID("LogContainer"), {
|
CLAY(CLAY_ID("LogContainer"), {
|
||||||
.layout = {
|
.layout = {
|
||||||
.sizing = layoutExpand,
|
.sizing = layoutExpand,
|
||||||
.padding = CLAY_PADDING_ALL(16),
|
.padding = CLAY_PADDING_ALL(16),
|
||||||
},
|
},
|
||||||
.backgroundColor = containerColors[0],
|
.INNER_CONTAINER(0)
|
||||||
.cornerRadius = defaultRadiusAll
|
|
||||||
}) {}
|
}) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
static inline void InitiativeListContainer() {
|
||||||
void InitiativeListContainer() {
|
|
||||||
CLAY(CLAY_ID("InitiativeListContainer"), {
|
CLAY(CLAY_ID("InitiativeListContainer"), {
|
||||||
.layout = {
|
.layout = {
|
||||||
.sizing = layoutExpand,
|
.sizing = layoutExpand,
|
||||||
.padding = CLAY_PADDING_ALL(16),
|
.padding = CLAY_PADDING_ALL(16),
|
||||||
},
|
},
|
||||||
.backgroundColor = containerColors[0],
|
.INNER_CONTAINER(0)
|
||||||
.cornerRadius = defaultRadiusAll,
|
|
||||||
}) {}
|
}) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Clay_RenderCommandArray RenderApplication() {
|
Clay_RenderCommandArray RenderApplication() {
|
||||||
Clay_BeginLayout();
|
Clay_BeginLayout();
|
||||||
CLAY(CLAY_ID("OuterContainer"), {
|
CLAY(CLAY_ID("OuterContainer"), windowStyle) {
|
||||||
.layout = {
|
|
||||||
.layoutDirection = CLAY_TOP_TO_BOTTOM,
|
|
||||||
.sizing = layoutExpand,
|
|
||||||
.padding = CLAY_PADDING_ALL(windowPadding),
|
|
||||||
.childGap = containerGap,
|
|
||||||
},
|
|
||||||
.backgroundColor = windowBackground
|
|
||||||
}) {
|
|
||||||
DiceContainer();
|
DiceContainer();
|
||||||
CLAY(CLAY_ID("LowerSplitContainer"), {
|
CLAY(CLAY_ID("LowerSplitContainer"), {
|
||||||
.layout = {
|
.layout = {
|
||||||
|
|
Loading…
Reference in a new issue