set layout size draggble

This commit is contained in:
2026-03-04 01:25:59 -05:00
parent 5aa0d7466e
commit 8891dcffb8
6 changed files with 147 additions and 18 deletions

View File

@@ -145,6 +145,7 @@ struct CustomRotatedIconData {
#define FONT_SIZE_NORMAL uifs(15)
#define FONT_SIZE_SMALL uifs(12)
#define FONT_SIZE_TAB uifs(13)
////////////////////////////////
// Widget sizing

View File

@@ -165,6 +165,7 @@ static Clay_TextElementConfig g_widget_text_config_dim;
static Clay_TextElementConfig g_widget_text_config_sel;
static Clay_TextElementConfig g_widget_text_config_btn;
static Clay_TextElementConfig g_widget_text_config_tab;
static Clay_TextElementConfig g_widget_text_config_tab_inactive;
static F32 g_widget_text_configs_scale = 0;
void ui_widgets_theme_changed() {
@@ -200,8 +201,14 @@ static void ensure_widget_text_configs() {
// Tab text (always light — readable on colored tab gradient)
g_widget_text_config_tab = {};
g_widget_text_config_tab.textColor = g_theme.tab_text;
g_widget_text_config_tab.fontSize = FONT_SIZE_NORMAL;
g_widget_text_config_tab.fontSize = FONT_SIZE_TAB;
g_widget_text_config_tab.wrapMode = CLAY_TEXT_WRAP_NONE;
// Inactive tab text (theme text color, smaller font)
g_widget_text_config_tab_inactive = {};
g_widget_text_config_tab_inactive.textColor = g_theme.text;
g_widget_text_config_tab_inactive.fontSize = FONT_SIZE_TAB;
g_widget_text_config_tab_inactive.wrapMode = CLAY_TEXT_WRAP_NONE;
}
static Clay_String clay_str(const char *s) {
@@ -1368,7 +1375,7 @@ S32 ui_tab_bar(const char *id, const char **labels, S32 count, S32 *selected) {
.backgroundColor = bg,
.cornerRadius = { .topLeft = TAB_CORNER_RADIUS, .topRight = TAB_CORNER_RADIUS, .bottomLeft = 0, .bottomRight = 0 },
) {
CLAY_TEXT(lbl_str, &g_widget_text_config);
CLAY_TEXT(lbl_str, &g_widget_text_config_tab_inactive);
}
}