Files
Seele/src/Engine/UI/Style/Style.h
T

62 lines
1.4 KiB
C++
Raw Normal View History

2025-01-08 19:15:12 +01:00
#pragma once
#include "Math/Vector.h"
#include "Asset/FontAsset.h"
#include "MinimalEngine.h"
namespace Seele {
namespace UI {
enum class DimensionType {
Pixel,
Percent, // EM, PEM, etc...
2025-01-12 11:26:52 +01:00
Auto,
2025-01-08 19:15:12 +01:00
};
enum class PositionType {
Static,
2025-01-12 11:26:52 +01:00
Relative,
2025-01-08 19:15:12 +01:00
Absolute,
Sticky,
};
2025-01-12 11:26:52 +01:00
enum class OuterDisplayType {
2025-01-08 19:15:12 +01:00
Inline,
Block,
2025-01-12 11:26:52 +01:00
Hidden,
};
enum class InnerDisplayType {
Flow,
2025-01-08 19:15:12 +01:00
Flex,
Grid,
};
struct Style {
2025-01-12 11:26:52 +01:00
DimensionType widthType = DimensionType::Auto;
float width = 0;
DimensionType maxWidthType = DimensionType::Auto;
float maxWidth = 0;
DimensionType heightType = DimensionType::Auto;
float height = 0;
DimensionType maxHeightType = DimensionType::Auto;
float maxHeight = 0;
2025-01-08 19:15:12 +01:00
uint32 z = 0;
Vector backgroundColor = Vector(1, 1, 1);
2025-01-12 11:26:52 +01:00
OuterDisplayType outerDisplay = OuterDisplayType::Inline;
InnerDisplayType innerDisplay = InnerDisplayType::Flow;
2025-01-08 19:15:12 +01:00
PositionType position = PositionType::Relative;
PFontAsset fontFamily;
2025-01-12 11:26:52 +01:00
uint32 lineHeight = 48;
uint32 fontSize = 48;
2025-01-08 19:15:12 +01:00
uint32 fontWeight = 0;
uint32 paddingTop = 0;
uint32 paddingBottom = 0;
uint32 paddingLeft = 0;
uint32 paddingRight = 0;
uint32 marginTop = 0;
uint32 marginBottom = 0;
uint32 marginLeft = 0;
uint32 marginRight = 0;
uint32 gap = 0;
2025-01-12 11:26:52 +01:00
uint32 top = 0;
uint32 bottom = 0;
uint32 left = 0;
uint32 right = 0;
2025-01-08 19:15:12 +01:00
};
} // namespace UI
} // namespace Seele