feat: adjusted layout and styling logic
This commit is contained in:
parent
456921e66b
commit
a98a67024b
|
@ -3,61 +3,62 @@
|
|||
#include "defs.h"
|
||||
#include "style.h"
|
||||
#include <SDL3/SDL.h>
|
||||
#include <clay/clay.h>
|
||||
|
||||
static inline
|
||||
void DiceContainer() {
|
||||
CLAY({ .id = CLAY_ID("DiceContainer"),
|
||||
CLAY(CLAY_ID("DiceContainer"), {
|
||||
.layout = {
|
||||
.sizing = { CLAY_SIZING_GROW(0), CLAY_SIZING_PERCENT(0.2) },
|
||||
.padding = CLAY_PADDING_ALL(16),
|
||||
},
|
||||
.backgroundColor = containerColors[0],
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(cornerRadius)
|
||||
.cornerRadius = defaultRadiusAll,
|
||||
}) {
|
||||
CLAY_TEXT(CLAY_STRING("Text data"), CLAY_TEXT_CONFIG({
|
||||
.textColor = textColors[0],
|
||||
.fontId = FONT_DEFAULT,
|
||||
.fontSize = 24,
|
||||
TEXT_BODY,
|
||||
.textColor = textColors[0]
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
static inline
|
||||
void DiceLogContainer() {
|
||||
CLAY({ .id = CLAY_ID("LogContainer"),
|
||||
CLAY(CLAY_ID("LogContainer"), {
|
||||
.layout = {
|
||||
.sizing = layoutExpand,
|
||||
.padding = CLAY_PADDING_ALL(16),
|
||||
},
|
||||
.backgroundColor = containerColors[0],
|
||||
.cornerRadius = cornerRadiusAll
|
||||
.cornerRadius = defaultRadiusAll
|
||||
}) {}
|
||||
}
|
||||
|
||||
static inline
|
||||
void InitiativeListContainer() {
|
||||
CLAY({ .id = CLAY_ID("InitiativeListContainer"),
|
||||
CLAY(CLAY_ID("InitiativeListContainer"), {
|
||||
.layout = {
|
||||
.sizing = layoutExpand,
|
||||
.padding = CLAY_PADDING_ALL(16),
|
||||
},
|
||||
.backgroundColor = containerColors[0],
|
||||
.cornerRadius = cornerRadiusAll,
|
||||
.cornerRadius = defaultRadiusAll,
|
||||
}) {}
|
||||
}
|
||||
|
||||
Clay_RenderCommandArray RenderApplication() {
|
||||
Clay_BeginLayout();
|
||||
CLAY({ .id = CLAY_ID("OuterContainer"),
|
||||
CLAY(CLAY_ID("OuterContainer"), {
|
||||
.layout = {
|
||||
.layoutDirection = CLAY_TOP_TO_BOTTOM,
|
||||
.sizing = layoutExpand,
|
||||
.padding = CLAY_PADDING_ALL(windowPadding),
|
||||
.childGap = containerGap
|
||||
}
|
||||
.childGap = containerGap,
|
||||
},
|
||||
.backgroundColor = windowBackground
|
||||
}) {
|
||||
DiceContainer();
|
||||
CLAY({ .id = CLAY_ID("LowerSplitContainer"),
|
||||
CLAY(CLAY_ID("LowerSplitContainer"), {
|
||||
.layout = {
|
||||
.sizing = layoutExpand,
|
||||
.childGap = containerGap
|
||||
|
|
21
src/style.h
21
src/style.h
|
@ -1,15 +1,24 @@
|
|||
#ifndef STYLE_H
|
||||
#define STYLE_H
|
||||
|
||||
#include "defs.h"
|
||||
#include <clay/clay.h>
|
||||
|
||||
constexpr float cornerRadius = 20.f;
|
||||
constexpr Clay_CornerRadius cornerRadiusAll = {
|
||||
cornerRadius, cornerRadius,
|
||||
cornerRadius, cornerRadius
|
||||
constexpr float defaultRadius = 5.f;
|
||||
constexpr Clay_CornerRadius defaultRadiusAll = {
|
||||
defaultRadius, defaultRadius,
|
||||
defaultRadius, defaultRadius
|
||||
};
|
||||
constexpr float containerGap = 10.f;
|
||||
constexpr float windowPadding = 10.f;
|
||||
constexpr float containerGap = 5.f;
|
||||
constexpr float windowPadding = 5.f;
|
||||
|
||||
|
||||
#define TEXT_BODY\
|
||||
.fontId = FONT_DEFAULT,\
|
||||
.fontSize = 15
|
||||
#define TEXT_H1\
|
||||
.fontId = FONT_BOLD,\
|
||||
.fontSize = 20
|
||||
|
||||
constexpr Clay_Color windowBackground = {
|
||||
255*0.35, 255*0.35, 255*0.35, 255
|
||||
|
|
Loading…
Reference in a new issue