color scheme -> palette; fix eval/watch views after cleanup; make more progress on new palette system

This commit is contained in:
Ryan Fleury
2024-06-21 09:49:51 -07:00
parent 3b27abd5c7
commit fc77844452
11 changed files with 364 additions and 340 deletions
+5 -4
View File
@@ -5708,10 +5708,11 @@ df_eval_viz_row_list_push_new(Arena *arena, EVAL_ParseCtx *parse_ctx, DF_EvalViz
rows->count += 1;
// rjf: fill basics
row->depth = block->depth;
row->parent_key = block->parent_key;
row->key = key;
row->eval = eval;
row->depth = block->depth;
row->parent_key = block->parent_key;
row->key = key;
row->eval = eval;
row->size_in_rows = 1;
// rjf: determine exandability, editability
if(tg_kind_from_key(eval.type_key) != TG_Kind_Null)
+175 -161
View File
@@ -3457,7 +3457,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
ui_push_font_size(main_font_size);
ui_push_pref_width(ui_em(20.f, 1));
ui_push_pref_height(ui_em(2.5f, 1.f));
ui_push_scheme(df_ui_color_scheme_from_code(DF_UIColorSchemeCode_Default));
ui_push_palette(df_palette_from_code(DF_PaletteCode_Default));
ui_push_blur_size(10.f);
}
@@ -3503,7 +3503,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
UI_Size main_width = ui_top_pref_width();
UI_Size main_height = ui_top_pref_height();
UI_TextAlign main_text_align = ui_top_text_alignment();
DF_UIColorScheme(DF_UIColorSchemeCode_TabActive)
DF_Palette(DF_PaletteCode_TabActive)
UI_Tooltip
UI_PrefWidth(main_width)
UI_PrefHeight(main_height)
@@ -3564,7 +3564,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
//- rjf: entity drop completion ctx menu
//
{
DF_UIColorScheme(DF_UIColorSchemeCode_Floating)
DF_Palette(DF_PaletteCode_Floating)
UI_CtxMenu(ws->drop_completion_ctx_menu_key)
UI_PrefWidth(ui_em(30.f, 1.f))
{
@@ -3715,7 +3715,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
////////////////////////////
//- rjf: universal ctx menus
//
DF_UIColorScheme(DF_UIColorSchemeCode_Floating)
DF_Palette(DF_PaletteCode_Floating)
{
Temp scratch = scratch_begin(&arena, 1);
@@ -3752,12 +3752,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
UI_Flags(UI_BoxFlag_DrawTextWeak)
ui_label(df_g_entity_kind_display_string_table[entity->kind]);
{
UI_ColorScheme *scheme = ui_top_scheme();
UI_Palette *palette = ui_top_palette();
if(entity->flags & DF_EntityFlag_HasColor)
{
scheme = ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity));
palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity));
}
UI_Scheme(scheme)
UI_Palette(palette)
UI_PrefWidth(ui_text_dim(10, 1))
UI_Font((kind_flags & DF_EntityKindFlag_NameIsCode) ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font())
ui_label(display_name);
@@ -3933,7 +3933,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
if(op_flags & DF_EntityOpFlag_Freeze)
{
B32 is_frozen = df_entity_is_frozen(entity);
ui_set_next_scheme(df_ui_color_scheme_from_code(is_frozen ? DF_UIColorSchemeCode_SpecialNegative : DF_UIColorSchemeCode_SpecialPositive));
ui_set_next_palette(df_palette_from_code(is_frozen ? DF_PaletteCode_SpecialNegative : DF_PaletteCode_SpecialPositive));
if(is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Locked, 0, "Thaw###freeze_thaw")))
{
DF_CmdParams params = df_cmd_params_from_window(ws);
@@ -4203,7 +4203,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
for(U64 preset_idx = 0; preset_idx < ArrayCount(presets); preset_idx += 1)
{
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
ui_set_next_scheme(ui_fork_top_color_scheme(.background = presets[preset_idx]));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = presets[preset_idx]));
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground|
UI_BoxFlag_DrawBorder|
UI_BoxFlag_Clickable|
@@ -4369,15 +4369,17 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
Vec2F32 window_dim = dim_2f32(window_rect);
UI_Box *bg_box = &ui_g_nil_box;
UI_Palette *palette = ui_build_palette(df_palette_from_code(DF_PaletteCode_Floating));
palette->background.w *= df_gfx_state->confirm_t;
UI_Rect(window_rect)
UI_ChildLayoutAxis(Axis2_X)
UI_Focus(UI_FocusKind_On)
UI_BlurSize(10*df_gfx_state->confirm_t)
DF_UIColorScheme(DF_UIColorSchemeCode_Floating)
UI_Palette(palette)
{
bg_box = ui_build_box_from_stringf(UI_BoxFlag_FixedSize|UI_BoxFlag_Floating|UI_BoxFlag_Clickable|UI_BoxFlag_Scroll|UI_BoxFlag_DefaultFocusNav|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_DrawBackground, "###confirm_popup_%p", ws);
}
if(df_gfx_state->confirm_active) UI_Parent(bg_box)
if(df_gfx_state->confirm_active) UI_Parent(bg_box) UI_Transparency(1-df_gfx_state->confirm_t)
{
ui_ctx_menu_close();
UI_WidthFill UI_PrefHeight(ui_children_sum(1.f)) UI_Column UI_Padding(ui_pct(1, 0))
@@ -4389,7 +4391,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
UI_CornerRadius00(ui_top_font_size()*0.25f)
UI_CornerRadius01(ui_top_font_size()*0.25f)
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral)
DF_Palette(DF_PaletteCode_SpecialNeutral)
if(ui_clicked(ui_buttonf("OK")) || (ui_key_match(bg_box->default_nav_focus_hot_key, ui_key_zero()) && ui_slot_press(UI_EventActionSlot_Accept)))
{
DF_CmdParams p = df_cmd_params_zero();
@@ -4707,7 +4709,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
os_window_push_custom_edges(ws->os, window_edge_px);
os_window_push_custom_title_bar(ws->os, dim_2f32(top_bar_rect).y);
ui_set_next_flags(UI_BoxFlag_DefaultFocusNav);
DF_UIColorScheme(DF_UIColorSchemeCode_MenuBar)
DF_Palette(DF_PaletteCode_MenuBar)
UI_Focus((ws->menu_bar_focused && window_is_focused && !ui_any_ctx_menu_is_open() && !hover_eval_is_open) ? UI_FocusKind_On : UI_FocusKind_Null)
UI_Pane(top_bar_rect, str8_lit("###top_bar"))
UI_WidthFill UI_Row
@@ -4892,14 +4894,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
for(DF_EntityNode *n = targets_list.first; n != 0; n = n->next)
{
DF_Entity *target = n->entity;
UI_ColorScheme *scheme = ui_top_scheme();
UI_Palette *palette = ui_top_palette();
if(target->flags & DF_EntityFlag_HasColor)
{
scheme = ui_fork_top_color_scheme(.text = df_rgba_from_entity(target));
palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(target));
}
String8 target_name = df_display_string_from_entity(scratch.arena, target);
UI_Signal sig = {0};
UI_Scheme(scheme) sig = df_icon_buttonf(DF_IconKind_Target, 0, "%S##%p", target_name, target);
UI_Palette(palette) sig = df_icon_buttonf(DF_IconKind_Target, 0, "%S##%p", target_name, target);
if(ui_clicked(sig))
{
DF_CmdParams params = df_cmd_params_from_window(ws);
@@ -5093,7 +5095,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
// rjf: conversion task visualization
UI_PrefWidth(ui_text_dim(10, 1)) UI_HeightFill
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral)
DF_Palette(DF_PaletteCode_SpecialNeutral)
{
Temp scratch = scratch_begin(&arena, 1);
DF_EntityList tasks = df_query_cached_entity_list_with_kind(DF_EntityKind_ConversionTask);
@@ -5140,7 +5142,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
if(can_play || !have_targets || processes.count == 0)
UI_TextAlignment(UI_TextAlign_Center)
UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled))
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialPositive)
DF_Palette(DF_PaletteCode_SpecialPositive)
{
UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Play]);
os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect);
@@ -5181,7 +5183,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
//- rjf: restart button
if(!can_play && processes.count != 0) UI_TextAlignment(UI_TextAlign_Center)
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialPositive)
DF_Palette(DF_PaletteCode_SpecialPositive)
{
UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Redo]);
os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect);
@@ -5216,7 +5218,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
//- rjf: pause button
UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_pause ? 0 : UI_BoxFlag_Disabled)
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral)
DF_Palette(DF_PaletteCode_SpecialNeutral)
{
UI_Signal sig = ui_button(df_g_icon_kind_text_table[DF_IconKind_Pause]);
os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect);
@@ -5243,7 +5245,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
//- rjf: stop button
UI_TextAlignment(UI_TextAlign_Center) UI_Flags(can_stop ? 0 : UI_BoxFlag_Disabled)
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative)
DF_Palette(DF_PaletteCode_SpecialNegative)
{
UI_Signal sig = {0};
{
@@ -5381,7 +5383,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
ui_spacer(ui_pct(1, 0));
// rjf: loaded user viz
if(do_user_prof) DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral)
if(do_user_prof) DF_Palette(DF_PaletteCode_SpecialNeutral)
{
ui_set_next_pref_width(ui_children_sum(1));
ui_set_next_child_layout_axis(Axis2_X);
@@ -5416,7 +5418,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
}
// rjf: loaded project viz
if(do_user_prof) DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral)
if(do_user_prof) DF_Palette(DF_PaletteCode_SpecialNeutral)
{
ui_set_next_pref_width(ui_children_sum(1));
ui_set_next_child_layout_axis(Axis2_X);
@@ -5463,7 +5465,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
max_sig = df_icon_buttonf(DF_IconKind_Window, 0, "##maximize");
}
UI_PrefWidth(ui_px(button_dim*2, 1.f))
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative)
DF_Palette(DF_PaletteCode_SpecialNegative)
{
cls_sig = df_icon_buttonf(DF_IconKind_X, 0, "##close");
}
@@ -5495,10 +5497,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
B32 is_running = df_ctrl_targets_running() && df_ctrl_last_run_frame_idx() < df_frame_index();
CTRL_Event stop_event = df_ctrl_last_stop_event();
UI_ColorScheme *positive_scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialPositive);
UI_ColorScheme *running_scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNeutral);
UI_ColorScheme *negative_scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNegative);
UI_ColorScheme *scheme = running_scheme;
UI_Palette *positive_scheme = df_palette_from_code(DF_PaletteCode_SpecialPositive);
UI_Palette *running_scheme = df_palette_from_code(DF_PaletteCode_SpecialNeutral);
UI_Palette *negative_scheme = df_palette_from_code(DF_PaletteCode_SpecialNegative);
UI_Palette *palette = running_scheme;
if(!is_running)
{
switch(stop_event.cause)
@@ -5506,21 +5508,21 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
default:
case CTRL_EventCause_Finished:
{
scheme = positive_scheme;
palette = positive_scheme;
}break;
case CTRL_EventCause_UserBreakpoint:
case CTRL_EventCause_InterruptedByException:
case CTRL_EventCause_InterruptedByTrap:
case CTRL_EventCause_InterruptedByHalt:
{
scheme = negative_scheme;
palette = negative_scheme;
}break;
}
}
if(ws->error_t > 0.01f)
{
UI_ColorScheme *blended_scheme = push_array(ui_build_arena(), UI_ColorScheme, 1);
MemoryCopyStruct(blended_scheme, scheme);
UI_Palette *blended_scheme = push_array(ui_build_arena(), UI_Palette, 1);
MemoryCopyStruct(blended_scheme, palette);
for(EachEnumVal(UI_ColorCode, code))
{
for(U64 idx = 0; idx < 4; idx += 1)
@@ -5528,10 +5530,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
blended_scheme->colors[code].v[idx] += (negative_scheme->colors[code].v[idx] - blended_scheme->colors[code].v[idx]) * ws->error_t;
}
}
scheme = blended_scheme;
palette = blended_scheme;
}
UI_Flags(UI_BoxFlag_DrawBackground) UI_CornerRadius(0)
UI_Scheme(scheme)
UI_Palette(palette)
UI_Pane(bottom_bar_rect, str8_lit("###bottom_bar")) UI_WidthFill UI_Row
UI_Flags(0)
{
@@ -5584,7 +5586,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
UI_Flags(UI_BoxFlag_DrawBackground)
UI_TextAlignment(UI_TextAlign_Center)
UI_CornerRadius(4)
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral)
DF_Palette(DF_PaletteCode_SpecialNeutral)
ui_labelf("Currently rebinding \"%S\" hotkey", df_gfx_state->bind_change_cmd_spec->info.display_name);
}
@@ -5752,6 +5754,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
//- rjf: build query text input
B32 query_completed = 0;
B32 query_cancelled = 0;
UI_Parent(query_container_box)
UI_WidthFill UI_PrefHeight(ui_px(query_line_edit_height, 1.f))
UI_Focus(UI_FocusKind_On)
@@ -5789,13 +5792,20 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
ws->query_view_selected = 1;
}
}
UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off)
UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_SpecialPositive)
{
if(ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "##complete_query")))
{
query_completed = 1;
}
}
UI_PrefWidth(ui_em(3.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(DF_PaletteCode_Default)
{
if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "##cancel_query")))
{
query_cancelled = 1;
}
}
}
}
@@ -5808,8 +5818,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
}
//- rjf: query submission
if((ui_is_focus_active() || (window_is_focused && !ui_any_ctx_menu_is_open() && !ws->menu_bar_focused && !ws->query_view_selected)) &&
ui_slot_press(UI_EventActionSlot_Cancel))
if(((ui_is_focus_active() || (window_is_focused && !ui_any_ctx_menu_is_open() && !ws->menu_bar_focused && !ws->query_view_selected)) &&
ui_slot_press(UI_EventActionSlot_Cancel)) || query_cancelled)
{
DF_CmdParams params = df_cmd_params_from_window(ws);
df_push_cmd__root(&params, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CancelQuery));
@@ -5842,7 +5852,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
}
//- rjf: build darkening overlay for rest of screen
UI_Scheme(ui_fork_top_color_scheme(.background = mix_4f32(df_rgba_from_theme_color(DF_ThemeColor_InactivePanelOverlay), v4f32(0, 0, 0, 0), 1-ws->query_view_selected_t)))
UI_Palette(ui_build_palette(ui_top_palette(), .background = mix_4f32(df_rgba_from_theme_color(DF_ThemeColor_InactivePanelOverlay), v4f32(0, 0, 0, 0), 1-ws->query_view_selected_t)))
UI_Rect(window_rect)
{
ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero());
@@ -5900,7 +5910,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
if(build_hover_eval && ws->hover_eval_string.size != 0 && hover_eval_is_open)
UI_Font(df_font_from_slot(DF_FontSlot_Code))
UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main))
DF_UIColorScheme(DF_UIColorSchemeCode_Floating)
DF_Palette(DF_PaletteCode_Floating)
{
Temp scratch = scratch_begin(&arena, 1);
DI_Scope *scope = di_scope_open();
@@ -6060,7 +6070,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_Highlight0);
rgba.w *= 0.2f;
ui_set_next_scheme(ui_fork_top_color_scheme(.background = rgba));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba));
}
UI_Signal sig = df_line_editf(DF_LineEditFlag_CodeContents|
DF_LineEditFlag_DisplayStringIsCode|
@@ -6087,7 +6097,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_Highlight0);
rgba.w *= 0.2f;
ui_set_next_scheme(ui_fork_top_color_scheme(.background = rgba));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba));
ui_set_next_flags(UI_BoxFlag_DrawBackground);
}
df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), row->display_value);
@@ -6243,7 +6253,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
ui_set_next_child_layout_axis(axis2_flip(axis));
if(ui_key_match(key, ui_drop_hot_key()))
{
ui_set_next_scheme(ui_fork_top_color_scheme(.border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)));
}
site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground|
UI_BoxFlag_DrawBorder|
@@ -6270,7 +6280,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
future_split_rect.p1.v[axis] += drop_site_major_dim_px;
future_split_rect.p0.v[axis2_flip(axis)] = panel_rect.p0.v[axis2_flip(axis)];
future_split_rect.p1.v[axis2_flip(axis)] = panel_rect.p1.v[axis2_flip(axis)];
UI_Rect(future_split_rect) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite)
UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSite)
{
ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero());
}
@@ -6328,7 +6338,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
ui_set_next_child_layout_axis(axis2_flip(split_axis));
if(ui_key_match(key, ui_drop_hot_key()))
{
ui_set_next_scheme(ui_fork_top_color_scheme(.border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)));
}
site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground|
UI_BoxFlag_DrawBorder|
@@ -6355,7 +6365,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
future_split_rect.p1.v[split_axis] += drop_site_major_dim_px;
future_split_rect.p0.v[axis2_flip(split_axis)] = child_rect.p0.v[axis2_flip(split_axis)];
future_split_rect.p1.v[axis2_flip(split_axis)] = child_rect.p1.v[axis2_flip(split_axis)];
UI_Rect(future_split_rect) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite)
UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSite)
{
ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero());
}
@@ -6631,7 +6641,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
ui_set_next_child_layout_axis(axis2_flip(split_axis));
if(ui_key_match(key, ui_drop_hot_key()))
{
ui_set_next_scheme(ui_fork_top_color_scheme(.border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)));
}
site_box_viz = ui_build_box_from_key(UI_BoxFlag_DrawBackground|
UI_BoxFlag_DrawBorder|
@@ -6646,10 +6656,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero()); UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f))
{
if(split_side == Side_Min) { ui_set_next_flags(UI_BoxFlag_DrawBackground); }
DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero());
DF_Palette(DF_PaletteCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero());
ui_spacer(ui_px(padding, 1.f));
if(split_side == Side_Max) { ui_set_next_flags(UI_BoxFlag_DrawBackground); }
DF_UIColorScheme(DF_UIColorSchemeCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero());
DF_Palette(DF_PaletteCode_DropSite) ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero());
}
}
}
@@ -6659,7 +6669,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
ui_set_next_child_layout_axis(split_axis);
UI_Box *row_or_column = ui_build_box_from_key(0, ui_key_zero());
UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite)
UI_Parent(row_or_column) UI_Padding(ui_px(padding, 1.f)) DF_Palette(DF_PaletteCode_DropSite)
{
ui_build_box_from_key(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, ui_key_zero());
}
@@ -6702,7 +6712,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
Vec2F32 panel_center = center_2f32(panel_rect);
future_split_rect.v[side_flip(split_side)].v[split_axis] = panel_center.v[split_axis];
}
UI_Rect(future_split_rect) DF_UIColorScheme(DF_UIColorSchemeCode_DropSite)
UI_Rect(future_split_rect) DF_Palette(DF_PaletteCode_DropSite)
{
ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero());
}
@@ -6849,7 +6859,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
F64 pct_done_f64 = ((F64)view->loading_progress_v/(F64)view->loading_progress_v_target);
F32 pct_done = (F32)pct_done_f64;
ui_set_next_scheme(ui_fork_top_color_scheme(.background = v4f32(1, 1, 1, 0.2f*view->loading_t)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = v4f32(1, 1, 1, 0.2f*view->loading_t)));
ui_set_next_fixed_x(indicator_region_rect.x0);
ui_set_next_fixed_y(indicator_region_rect.y0);
ui_set_next_fixed_width(dim_2f32(indicator_region_rect).x*pct_done);
@@ -6858,7 +6868,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
}
// rjf: fill
ui_set_next_scheme(ui_fork_top_color_scheme(.background = hl_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = hl_color));
ui_set_next_fixed_x(indicator_rect.x0);
ui_set_next_fixed_y(indicator_rect.y0);
ui_set_next_fixed_width(dim_2f32(indicator_rect).x);
@@ -6866,7 +6876,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero());
// rjf: animated bar
ui_set_next_scheme(ui_fork_top_color_scheme(.border = bd_color, .background = bg_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = bd_color, .background = bg_color));
ui_set_next_fixed_x(indicator_region_rect.x0);
ui_set_next_fixed_y(indicator_region_rect.y0);
ui_set_next_fixed_width(dim_2f32(indicator_region_rect).x);
@@ -6878,7 +6888,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
// rjf: build background
UI_WidthFill UI_HeightFill
{
ui_set_next_scheme(ui_fork_top_color_scheme(.background = bg_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = bg_color));
ui_set_next_blur_size(10.f*view->loading_t);
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero());
}
@@ -7030,7 +7040,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
ui_spacer(ui_em(0.2f, 1.f));
UI_CornerRadius00(corner_radius)
UI_CornerRadius10(corner_radius)
DF_UIColorScheme(DF_UIColorSchemeCode_DropSite)
DF_Palette(DF_PaletteCode_DropSite)
{
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero());
}
@@ -7055,7 +7065,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
UI_Box *tab_column_box = ui_build_box_from_stringf(!is_changing_panel_boundaries*UI_BoxFlag_AnimatePosX, "tab_column_%p", view);
// rjf: build tab container box
UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_UIColorScheme(view_is_selected ? DF_UIColorSchemeCode_TabActive : DF_UIColorSchemeCode_TabInactive)
UI_Parent(tab_column_box) UI_PrefHeight(ui_px(tab_bar_vheight, 1)) DF_Palette(view_is_selected ? DF_PaletteCode_TabActive : DF_PaletteCode_TabInactive)
{
if((!view_is_selected && panel->tab_side == Side_Min) ||
(view_is_selected && panel->tab_side == Side_Max))
@@ -7100,7 +7110,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
df_font_from_slot(DF_FontSlot_Main),
label,
ui_top_scheme()->colors[UI_ColorCode_Text],
ui_top_palette()->colors[UI_ColorCode_Text],
ui_top_font_size(),
};
d_fancy_string_list_push(scratch.arena, &fstrs, &view_title);
@@ -7120,7 +7130,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
df_font_from_slot(DF_FontSlot_Code),
str8(view->query_buffer, view->query_string_size),
ui_top_scheme()->colors[UI_ColorCode_TextWeak],
ui_top_palette()->colors[UI_ColorCode_TextWeak],
ui_top_font_size(),
};
d_fancy_string_list_push(scratch.arena, &fstrs, &query);
@@ -7141,6 +7151,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
UI_CornerRadius00(0)
UI_CornerRadius01(0)
{
UI_Palette *palette = ui_build_palette(ui_top_palette());
palette->background = v4f32(0, 0, 0, 0);
ui_set_next_palette(palette);
UI_Signal sig = ui_buttonf("%S###close_view_%p", df_g_icon_kind_text_table[DF_IconKind_X], view);
if(ui_clicked(sig) || ui_middle_clicked(sig))
{
@@ -7279,8 +7292,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
DF_Panel *drag_panel = df_panel_from_handle(df_g_drag_drop_payload.panel);
if(!df_view_is_nil(view) && active_drop_site != 0)
{
UI_Scheme(ui_push_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay)))
UI_Rect(tab_bar_rect)
DF_Palette(DF_PaletteCode_DropSite) UI_Rect(tab_bar_rect)
ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero());
}
@@ -7339,7 +7351,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
// rjf: vis
{
UI_Scheme(ui_push_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay))) UI_Rect(content_rect)
DF_Palette(DF_PaletteCode_DropSite) UI_Rect(content_rect)
ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero());
}
@@ -7638,7 +7650,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
// rjf: main rectangle
{
R_Rect2DInst *inst = d_rect(pad_2f32(box->rect, 1.5f), box->scheme->colors[UI_ColorCode_Background], 0, 0, 1.f);
R_Rect2DInst *inst = d_rect(pad_2f32(box->rect, 1.5f), box->palette->colors[UI_ColorCode_Background], 0, 0, 1.f);
MemoryCopyArray(inst->corner_radii, box->corner_radii);
}
@@ -7834,7 +7846,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
// rjf: draw border
if(b->flags & UI_BoxFlag_DrawBorder)
{
R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1), b->scheme->colors[UI_ColorCode_Border], 0, 1.f, 1.f);
R_Rect2DInst *inst = d_rect(pad_2f32(b->rect, 1), b->palette->colors[UI_ColorCode_Border], 0, 1.f, 1.f);
MemoryCopyArray(inst->corner_radii, b->corner_radii);
// rjf: hover effect
@@ -7859,19 +7871,19 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
F32 softness = 0.5f;
if(b->flags & UI_BoxFlag_DrawSideTop)
{
d_rect(r2f32p(r.x0, r.y0-half_thickness, r.x1, r.y0+half_thickness), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness);
d_rect(r2f32p(r.x0, r.y0-half_thickness, r.x1, r.y0+half_thickness), b->palette->colors[UI_ColorCode_Border], 0, 0, softness);
}
if(b->flags & UI_BoxFlag_DrawSideBottom)
{
d_rect(r2f32p(r.x0, r.y1-half_thickness, r.x1, r.y1+half_thickness), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness);
d_rect(r2f32p(r.x0, r.y1-half_thickness, r.x1, r.y1+half_thickness), b->palette->colors[UI_ColorCode_Border], 0, 0, softness);
}
if(b->flags & UI_BoxFlag_DrawSideLeft)
{
d_rect(r2f32p(r.x0-half_thickness, r.y0, r.x0+half_thickness, r.y1), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness);
d_rect(r2f32p(r.x0-half_thickness, r.y0, r.x0+half_thickness, r.y1), b->palette->colors[UI_ColorCode_Border], 0, 0, softness);
}
if(b->flags & UI_BoxFlag_DrawSideRight)
{
d_rect(r2f32p(r.x1-half_thickness, r.y0, r.x1+half_thickness, r.y1), b->scheme->colors[UI_ColorCode_Border], 0, 0, softness);
d_rect(r2f32p(r.x1-half_thickness, r.y0, r.x1+half_thickness, r.y1), b->palette->colors[UI_ColorCode_Border], 0, 0, softness);
}
}
@@ -9262,12 +9274,12 @@ df_theme_color_from_txt_token_kind(TXT_TokenKind kind)
return color;
}
//- rjf: code -> ui color scheme
//- rjf: code -> palette
internal UI_ColorScheme *
df_ui_color_scheme_from_code(DF_UIColorSchemeCode code)
internal UI_Palette *
df_palette_from_code(DF_PaletteCode code)
{
UI_ColorScheme *result = &df_gfx_state->cfg_ui_color_schemes[code];
UI_Palette *result = &df_gfx_state->cfg_palettes[code];
return result;
}
@@ -9775,28 +9787,28 @@ df_cmd_binding_button(DF_CmdSpec *spec)
}
}
//- rjf: form color scheme
UI_ColorScheme *scheme = ui_top_scheme();
//- rjf: form color palette
UI_Palette *palette = ui_top_palette();
if(has_conflicts || (df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec))
{
scheme = push_array(ui_build_arena(), UI_ColorScheme, 1);
MemoryCopyStruct(scheme, ui_top_scheme());
palette = push_array(ui_build_arena(), UI_Palette, 1);
MemoryCopyStruct(palette, ui_top_palette());
if(has_conflicts)
{
scheme->colors[UI_ColorCode_Text] = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextNegative);
palette->colors[UI_ColorCode_Text] = df_rgba_from_theme_color(DF_ThemeColor_DefaultTextNegative);
}
if(df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec)
{
scheme->colors[UI_ColorCode_Border] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1);
scheme->colors[UI_ColorCode_Background] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1);
scheme->colors[UI_ColorCode_Background].w *= 0.25f;
palette->colors[UI_ColorCode_Border] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1);
palette->colors[UI_ColorCode_Background] = df_rgba_from_theme_color(DF_ThemeColor_Highlight1);
palette->colors[UI_ColorCode_Background].w *= 0.25f;
}
}
//- rjf: build box
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
ui_set_next_text_alignment(UI_TextAlign_Center);
ui_set_next_scheme(scheme);
ui_set_next_palette(palette);
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|
UI_BoxFlag_Clickable|
UI_BoxFlag_DrawActiveEffects,
@@ -9995,7 +10007,7 @@ df_entity_tooltips(DF_Entity *entity)
{
if(entity->flags & DF_EntityFlag_HasColor)
{
ui_set_next_scheme(ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity)));
}
UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_string);
}
@@ -10009,7 +10021,7 @@ df_entity_tooltips(DF_Entity *entity)
String8 explanation = df_stop_explanation_string_icon_from_ctrl_event(scratch.arena, &stop_event, &icon_kind);
if(explanation.size != 0)
{
UI_PrefWidth(ui_children_sum(1)) UI_Row DF_UIColorScheme(DF_UIColorSchemeCode_DefaultNegative)
UI_PrefWidth(ui_children_sum(1)) UI_Row DF_Palette(DF_PaletteCode_DefaultNegative)
{
UI_PrefWidth(ui_em(1.5f, 1.f)) UI_Font(df_font_from_slot(DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[icon_kind]);
UI_PrefWidth(ui_text_dim(10, 1)) ui_label(explanation);
@@ -10080,7 +10092,7 @@ df_entity_tooltips(DF_Entity *entity)
{
if(entity->flags & DF_EntityFlag_HasColor)
{
ui_set_next_scheme(ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity)));
}
String8 display_string = df_display_string_from_entity(scratch.arena, entity);
UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_string);
@@ -10108,7 +10120,7 @@ df_entity_tooltips(DF_Entity *entity)
{
if(entity->flags & DF_EntityFlag_HasColor)
{
ui_set_next_scheme(ui_fork_top_color_scheme(.text = df_rgba_from_entity(entity)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity)));
}
String8 display_string = df_display_string_from_entity(scratch.arena, entity);
UI_PrefWidth(ui_text_dim(10, 1)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), display_string);
@@ -10122,7 +10134,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam
{
ProfBeginFunction();
Temp scratch = scratch_begin(0, 0);
UI_ColorScheme *scheme = ui_top_scheme();
UI_Palette *palette = ui_top_palette();
if(entity->kind == DF_EntityKind_Thread)
{
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_window(ws);
@@ -10131,7 +10143,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam
DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread);
if(selected_thread == entity)
{
scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNeutral);
palette = df_palette_from_code(DF_PaletteCode_SpecialNeutral);
}
if(stopped_thread == entity &&
(stop_event.cause == CTRL_EventCause_UserBreakpoint ||
@@ -10139,19 +10151,19 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam
stop_event.cause == CTRL_EventCause_InterruptedByTrap ||
stop_event.cause == CTRL_EventCause_InterruptedByHalt))
{
scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNegative);
palette = df_palette_from_code(DF_PaletteCode_SpecialNegative);
}
}
if(entity->cfg_src == DF_CfgSrc_CommandLine)
{
scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNeutral);
palette = df_palette_from_code(DF_PaletteCode_SpecialNeutral);
}
else if(entity->kind == DF_EntityKind_Target && entity->b32 != 0)
{
scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_DefaultPositive);
palette = df_palette_from_code(DF_PaletteCode_DefaultPositive);
}
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
ui_set_next_scheme(scheme);
ui_set_next_palette(palette);
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|
UI_BoxFlag_DrawBorder|
UI_BoxFlag_DrawBackground|
@@ -10165,8 +10177,8 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam
DF_EntityKindFlags kind_flags = df_g_entity_kind_flags_table[entity->kind];
DF_EntityOpFlags op_flags = df_g_entity_kind_op_flags_table[entity->kind];
DF_IconKind icon = df_g_entity_kind_icon_kind_table[entity->kind];
Vec4F32 entity_color = scheme->colors[UI_ColorCode_Text];
Vec4F32 entity_color_weak = scheme->colors[UI_ColorCode_TextWeak];
Vec4F32 entity_color = palette->colors[UI_ColorCode_Text];
Vec4F32 entity_color_weak = palette->colors[UI_ColorCode_TextWeak];
if(entity->flags & DF_EntityFlag_HasColor)
{
entity_color = df_rgba_from_entity(entity);
@@ -10198,8 +10210,9 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam
}
}
String8 label = df_display_string_from_entity(scratch.arena, entity);
UI_Scheme(ui_fork_top_color_scheme(.text = entity_color))
UI_Palette(ui_build_palette(ui_top_palette(), .text = entity_color))
UI_Font(kind_flags&DF_EntityKindFlag_NameIsCode ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font())
UI_Flags(entity->kind == DF_EntityKind_Thread ? UI_BoxFlag_DisableTruncatedHover : 0)
{
UI_Signal label_sig = ui_label(label);
if(name_matches != 0)
@@ -10219,7 +10232,8 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam
if(entity->kind == DF_EntityKind_Thread)
UI_FontSize(ui_top_font_size()*0.75f)
UI_Font(df_font_from_slot(DF_FontSlot_Code))
UI_Scheme(ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure)))
UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure)))
UI_Flags(UI_BoxFlag_DisableTruncatedHover)
{
CTRL_Unwind unwind = df_query_cached_unwind_from_thread(entity);
DF_Entity *process = df_entity_ancestor_from_kind(entity, DF_EntityKind_Process);
@@ -10710,7 +10724,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
ui_set_next_font_size(params->font_size);
ui_set_next_pref_width(ui_pct(1, 0));
ui_set_next_pref_height(ui_pct(1, 0));
ui_set_next_scheme(ui_fork_top_color_scheme(.text = color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color));
ui_set_next_text_alignment(UI_TextAlign_Center);
UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%p", thread);
UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc|
@@ -10874,7 +10888,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
ui_set_next_font_size(params->font_size);
ui_set_next_pref_width(ui_pct(1, 0));
ui_set_next_pref_height(ui_pct(1, 0));
ui_set_next_scheme(ui_fork_top_color_scheme(.text = color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color));
ui_set_next_text_alignment(UI_TextAlign_Center);
UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%p", thread);
UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc|
@@ -10997,7 +11011,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons));
ui_set_next_font_size(params->font_size * 1.f);
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
ui_set_next_scheme(ui_fork_top_color_scheme(.text = bp_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = bp_color));
ui_set_next_text_alignment(UI_TextAlign_Center);
UI_Box *bp_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|
UI_BoxFlag_DrawActiveEffects|
@@ -11064,7 +11078,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
ui_set_next_font(df_font_from_slot(DF_FontSlot_Icons));
ui_set_next_font_size(params->font_size * 1.f);
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
ui_set_next_scheme(ui_fork_top_color_scheme(.text = color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color));
ui_set_next_text_alignment(UI_TextAlign_Center);
UI_Box *pin_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|
UI_BoxFlag_DrawActiveEffects|
@@ -11245,7 +11259,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
}
UI_PrefWidth(ui_em(1.5f, 1.f))
UI_Font(df_font_from_slot(DF_FontSlot_Icons))
UI_Scheme(ui_fork_top_color_scheme(.text = pin_color))
UI_Palette(ui_build_palette(ui_top_palette(), .text = pin_color))
UI_TextAlignment(UI_TextAlign_Center)
UI_Flags(UI_BoxFlag_DisableTextTrunc)
{
@@ -11563,7 +11577,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
{
TxtRngColorPairNode *n = push_array(scratch.arena, TxtRngColorPairNode, 1);
n->rng = txt_rng(*cursor, *mark);
n->color = ui_top_scheme()->colors[DF_ThemeColor_Selection];
n->color = ui_top_palette()->colors[DF_ThemeColor_Selection];
SLLQueuePush(first_txt_rng_color_pair, last_txt_rng_color_pair, n);
}
@@ -11670,7 +11684,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
}
// rjf: build line num box
ui_set_next_scheme(ui_fork_top_color_scheme(.text = text_color, .background = bg_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = text_color, .background = bg_color));
ui_build_box_from_stringf(UI_BoxFlag_DrawText|(UI_BoxFlag_DrawBackground*!!has_line_info), "%I64u##line_num", line_num);
}
}
@@ -11691,7 +11705,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
UI_Font(params->font)
UI_FontSize(params->font_size)
UI_CornerRadius(0)
DF_UIColorScheme(DF_UIColorSchemeCode_Code)
DF_Palette(DF_PaletteCode_Code)
{
U64 line_idx = 0;
for(S64 line_num = params->line_num_range.min;
@@ -11706,7 +11720,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
if(line_bg_color.w != 0)
{
ui_set_next_flags(UI_BoxFlag_DrawBackground);
ui_set_next_scheme(ui_fork_top_color_scheme(.background = line_bg_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = line_bg_color));
}
UI_Box *line_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc|UI_BoxFlag_DrawText|UI_BoxFlag_DisableIDString, line_key);
D_Bucket *line_bucket = d_bucket_make();
@@ -11947,7 +11961,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
ui_box_text_position(line_box).x+cursor_off_pixels+cursor_thickness,
line_box->rect.y1+params->font_size*0.25f,
};
d_rect(cursor_rect, ui_top_scheme()->colors[UI_ColorCode_Cursor], 1.f, 0, 1.f);
d_rect(cursor_rect, ui_top_palette()->colors[UI_ColorCode_Cursor], 1.f, 0, 1.f);
}
// rjf: extra rendering for lines with line-info that match the hovered
@@ -12827,7 +12841,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx
if(!(flags & DF_LineEditFlag_PreferDisplayString) && pre_edit_value.size != 0)
{
display_string = pre_edit_value;
UI_Box *box = df_code_label(1.f, 1, ui_top_scheme()->text, display_string);
UI_Box *box = df_code_label(1.f, 1, ui_top_palette()->text, display_string);
if(matches != 0)
{
ui_box_equip_fuzzy_match_ranges(box, matches);
@@ -12835,7 +12849,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx
}
else if(flags & DF_LineEditFlag_DisplayStringIsCode)
{
UI_Box *box = df_code_label(1.f, 1, ui_top_scheme()->text, display_string);
UI_Box *box = df_code_label(1.f, 1, ui_top_palette()->text, display_string);
if(matches != 0)
{
ui_box_equip_fuzzy_match_ranges(box, matches);
@@ -12876,7 +12890,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx
F32 total_editstr_width = total_text_width - !!(flags & (DF_LineEditFlag_Expander|DF_LineEditFlag_ExpanderSpace|DF_LineEditFlag_ExpanderPlaceholder)) * expander_size_px;
ui_set_next_pref_width(ui_px(total_editstr_width+ui_top_font_size()*2, 0.f));
UI_Box *editstr_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DisableTextTrunc, "###editstr");
D_FancyStringList code_fancy_strings = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, ui_top_scheme()->text, edit_string);
D_FancyStringList code_fancy_strings = df_fancy_string_list_from_code_string(scratch.arena, 1.f, 0, ui_top_palette()->text, edit_string);
if(autocomplete_hint_string.size != 0)
{
String8 query_word = df_autocomp_query_word_from_input_string_off(edit_string, cursor->column-1);
@@ -12898,7 +12912,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx
D_FancyString *fstr = &autocomp_fstr_n->v;
fstr->font = ui_top_font();
fstr->string = autocomplete_append_string;
fstr->color = ui_top_scheme()->text;
fstr->color = ui_top_palette()->text;
fstr->color.w *= 0.5f;
fstr->size = ui_top_font_size();
autocomp_fstr_n->next = prev_n ? prev_n->next : 0;
@@ -14066,60 +14080,60 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds)
//- rjf: compute ui color schemes from theme
{
DF_Theme *current = &df_gfx_state->cfg_theme;
for(EachEnumVal(DF_UIColorSchemeCode, code))
for(EachEnumVal(DF_PaletteCode, code))
{
df_gfx_state->cfg_ui_color_schemes[code].null = v4f32(1, 0, 1, 1);
df_gfx_state->cfg_ui_color_schemes[code].cursor = current->colors[DF_ThemeColor_CursorActive];
df_gfx_state->cfg_ui_color_schemes[code].selection = current->colors[DF_ThemeColor_Selection];
df_gfx_state->cfg_palettes[code].null = v4f32(1, 0, 1, 1);
df_gfx_state->cfg_palettes[code].cursor = current->colors[DF_ThemeColor_CursorActive];
df_gfx_state->cfg_palettes[code].selection = current->colors[DF_ThemeColor_Selection];
}
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].background = current->colors[DF_ThemeColor_DefaultBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].text = current->colors[DF_ThemeColor_DefaultText];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Default].border = current->colors[DF_ThemeColor_DefaultBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].background = current->colors[DF_ThemeColor_DefaultBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].text = current->colors[DF_ThemeColor_DefaultTextPositive];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultPositive].border = current->colors[DF_ThemeColor_DefaultBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].background = current->colors[DF_ThemeColor_DefaultBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].text = current->colors[DF_ThemeColor_DefaultTextNegative];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DefaultNegative].border = current->colors[DF_ThemeColor_DefaultBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].background = current->colors[DF_ThemeColor_FloatingBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].text = current->colors[DF_ThemeColor_FloatingText];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].text_weak = current->colors[DF_ThemeColor_FloatingTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Floating].border = current->colors[DF_ThemeColor_FloatingBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].background = current->colors[DF_ThemeColor_SpecialPositiveBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].text = current->colors[DF_ThemeColor_SpecialPositiveText];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].text_weak = current->colors[DF_ThemeColor_SpecialPositiveTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialPositive].border = current->colors[DF_ThemeColor_SpecialPositiveBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].background = current->colors[DF_ThemeColor_SpecialNegativeBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].text = current->colors[DF_ThemeColor_SpecialNegativeText];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].text_weak = current->colors[DF_ThemeColor_SpecialNegativeTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNegative].border = current->colors[DF_ThemeColor_SpecialNegativeBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].background = current->colors[DF_ThemeColor_SpecialNeutralBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].text = current->colors[DF_ThemeColor_SpecialNeutralText];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].text_weak = current->colors[DF_ThemeColor_SpecialNeutralTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_SpecialNeutral].border = current->colors[DF_ThemeColor_SpecialNeutralBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].background = current->colors[DF_ThemeColor_MenuBarBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].text = current->colors[DF_ThemeColor_MenuBarText];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_MenuBar].border = current->colors[DF_ThemeColor_MenuBarBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].background = current->colors[DF_ThemeColor_TabActiveBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].text = current->colors[DF_ThemeColor_TabActiveText];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].text_weak = current->colors[DF_ThemeColor_TabActiveTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabActive].border = current->colors[DF_ThemeColor_TabActiveBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].background = current->colors[DF_ThemeColor_TabInactiveBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].text = current->colors[DF_ThemeColor_TabInactiveText];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].text_weak = current->colors[DF_ThemeColor_TabInactiveTextWeak];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_TabInactive].border = current->colors[DF_ThemeColor_TabInactiveBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].background = current->colors[DF_ThemeColor_CodeBackground];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].text = current->colors[DF_ThemeColor_CodeDefault];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].text_weak = current->colors[DF_ThemeColor_CodeDefault];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_Code].border = current->colors[DF_ThemeColor_DefaultBorder];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].background = current->colors[DF_ThemeColor_DropSiteOverlay];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].text = current->colors[DF_ThemeColor_DropSiteOverlay];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].text_weak = current->colors[DF_ThemeColor_DropSiteOverlay];
df_gfx_state->cfg_ui_color_schemes[DF_UIColorSchemeCode_DropSite].border = current->colors[DF_ThemeColor_DropSiteOverlay];
df_gfx_state->cfg_palettes[DF_PaletteCode_Default].background = current->colors[DF_ThemeColor_DefaultBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_Default].text = current->colors[DF_ThemeColor_DefaultText];
df_gfx_state->cfg_palettes[DF_PaletteCode_Default].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_Default].border = current->colors[DF_ThemeColor_DefaultBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].background = current->colors[DF_ThemeColor_DefaultBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].text = current->colors[DF_ThemeColor_DefaultTextPositive];
df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultPositive].border = current->colors[DF_ThemeColor_DefaultBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].background = current->colors[DF_ThemeColor_DefaultBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].text = current->colors[DF_ThemeColor_DefaultTextNegative];
df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].text_weak = current->colors[DF_ThemeColor_DefaultTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_DefaultNegative].border = current->colors[DF_ThemeColor_DefaultBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].background = current->colors[DF_ThemeColor_FloatingBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text = current->colors[DF_ThemeColor_FloatingText];
df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].text_weak = current->colors[DF_ThemeColor_FloatingTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_Floating].border = current->colors[DF_ThemeColor_FloatingBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].background = current->colors[DF_ThemeColor_SpecialPositiveBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].text = current->colors[DF_ThemeColor_SpecialPositiveText];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].text_weak = current->colors[DF_ThemeColor_SpecialPositiveTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialPositive].border = current->colors[DF_ThemeColor_SpecialPositiveBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].background = current->colors[DF_ThemeColor_SpecialNegativeBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].text = current->colors[DF_ThemeColor_SpecialNegativeText];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].text_weak = current->colors[DF_ThemeColor_SpecialNegativeTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNegative].border = current->colors[DF_ThemeColor_SpecialNegativeBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].background = current->colors[DF_ThemeColor_SpecialNeutralBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].text = current->colors[DF_ThemeColor_SpecialNeutralText];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].text_weak = current->colors[DF_ThemeColor_SpecialNeutralTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_SpecialNeutral].border = current->colors[DF_ThemeColor_SpecialNeutralBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].background = current->colors[DF_ThemeColor_MenuBarBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text = current->colors[DF_ThemeColor_MenuBarText];
df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].text_weak = current->colors[DF_ThemeColor_MenuBarTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_MenuBar].border = current->colors[DF_ThemeColor_MenuBarBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].background = current->colors[DF_ThemeColor_TabActiveBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].text = current->colors[DF_ThemeColor_TabActiveText];
df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].text_weak = current->colors[DF_ThemeColor_TabActiveTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_TabActive].border = current->colors[DF_ThemeColor_TabActiveBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].background = current->colors[DF_ThemeColor_TabInactiveBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text = current->colors[DF_ThemeColor_TabInactiveText];
df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].text_weak = current->colors[DF_ThemeColor_TabInactiveTextWeak];
df_gfx_state->cfg_palettes[DF_PaletteCode_TabInactive].border = current->colors[DF_ThemeColor_TabInactiveBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_Code].background = current->colors[DF_ThemeColor_CodeBackground];
df_gfx_state->cfg_palettes[DF_PaletteCode_Code].text = current->colors[DF_ThemeColor_CodeDefault];
df_gfx_state->cfg_palettes[DF_PaletteCode_Code].text_weak = current->colors[DF_ThemeColor_CodeDefault];
df_gfx_state->cfg_palettes[DF_PaletteCode_Code].border = current->colors[DF_ThemeColor_DefaultBorder];
df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].background = current->colors[DF_ThemeColor_DropSiteOverlay];
df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].text = current->colors[DF_ThemeColor_DropSiteOverlay];
df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].text_weak = current->colors[DF_ThemeColor_DropSiteOverlay];
df_gfx_state->cfg_palettes[DF_PaletteCode_DropSite].border = current->colors[DF_ThemeColor_DropSiteOverlay];
}
//- rjf: animate alive-transitions for entities
+20 -20
View File
@@ -374,23 +374,23 @@ typedef enum DF_FontSlot
}
DF_FontSlot;
typedef enum DF_UIColorSchemeCode
typedef enum DF_PaletteCode
{
DF_UIColorSchemeCode_Default,
DF_UIColorSchemeCode_DefaultPositive,
DF_UIColorSchemeCode_DefaultNegative,
DF_UIColorSchemeCode_Floating,
DF_UIColorSchemeCode_SpecialPositive,
DF_UIColorSchemeCode_SpecialNegative,
DF_UIColorSchemeCode_SpecialNeutral,
DF_UIColorSchemeCode_MenuBar,
DF_UIColorSchemeCode_TabActive,
DF_UIColorSchemeCode_TabInactive,
DF_UIColorSchemeCode_Code,
DF_UIColorSchemeCode_DropSite,
DF_UIColorSchemeCode_COUNT
DF_PaletteCode_Default,
DF_PaletteCode_DefaultPositive,
DF_PaletteCode_DefaultNegative,
DF_PaletteCode_Floating,
DF_PaletteCode_SpecialPositive,
DF_PaletteCode_SpecialNegative,
DF_PaletteCode_SpecialNeutral,
DF_PaletteCode_MenuBar,
DF_PaletteCode_TabActive,
DF_PaletteCode_TabInactive,
DF_PaletteCode_Code,
DF_PaletteCode_DropSite,
DF_PaletteCode_COUNT
}
DF_UIColorSchemeCode;
DF_PaletteCode;
////////////////////////////////
//~ rjf: UI Helper & Widget Types
@@ -760,8 +760,8 @@ struct DF_GfxState
Arena *cfg_code_font_path_arena;
String8 cfg_main_font_path;
String8 cfg_code_font_path;
F_Tag cfg_font_tags[DF_FontSlot_COUNT];
UI_ColorScheme cfg_ui_color_schemes[DF_UIColorSchemeCode_COUNT];
F_Tag cfg_font_tags[DF_FontSlot_COUNT]; // derivative from font paths
UI_Palette cfg_palettes[DF_PaletteCode_COUNT]; // derivative from theme
// rjf: icon texture
R_Handle icon_texture;
@@ -1007,8 +1007,8 @@ internal DF_CmdSpecList df_cmd_spec_list_from_event_flags(Arena *arena, OS_Event
internal Vec4F32 df_rgba_from_theme_color(DF_ThemeColor color);
internal DF_ThemeColor df_theme_color_from_txt_token_kind(TXT_TokenKind kind);
//- rjf: code -> ui color scheme
internal UI_ColorScheme *df_ui_color_scheme_from_code(DF_UIColorSchemeCode code);
//- rjf: code -> palette
internal UI_Palette *df_palette_from_code(DF_PaletteCode code);
//- rjf: fonts/sizes
internal F_Tag df_font_from_slot(DF_FontSlot slot);
@@ -1026,7 +1026,7 @@ internal String8 df_stop_explanation_string_icon_from_ctrl_event(Arena *arena, C
////////////////////////////////
//~ rjf: UI Building Helpers
#define DF_UIColorScheme(code) UI_Scheme(df_ui_color_scheme_from_code(code))
#define DF_Palette(code) UI_Palette(df_palette_from_code(code))
////////////////////////////////
//~ rjf: UI Widgets: Fancy Buttons
+5 -5
View File
@@ -340,13 +340,13 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
text_box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero());
D_FancyStringList fancy_strings = {0};
{
D_FancyString open_paren = {ui_top_font(), str8_lit("("), ui_top_scheme()->text, ui_top_font_size(), 0, 0};
D_FancyString comma = {ui_top_font(), str8_lit(", "), ui_top_scheme()->text, ui_top_font_size(), 0, 0};
D_FancyString open_paren = {ui_top_font(), str8_lit("("), ui_top_palette()->text, ui_top_font_size(), 0, 0};
D_FancyString comma = {ui_top_font(), str8_lit(", "), ui_top_palette()->text, ui_top_font_size(), 0, 0};
D_FancyString r_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.x), v4f32(1.f, 0.25f, 0.25f, 1.f), ui_top_font_size(), 4.f, 0};
D_FancyString g_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.y), v4f32(0.25f, 1.f, 0.25f, 1.f), ui_top_font_size(), 4.f, 0};
D_FancyString b_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.z), v4f32(0.25f, 0.25f, 1.f, 1.f), ui_top_font_size(), 4.f, 0};
D_FancyString a_fstr = {ui_top_font(), push_str8f(scratch.arena, "%.2f", rgba.w), v4f32(1.f, 1.f, 1.f, 1.f), ui_top_font_size(), 4.f, 0};
D_FancyString clse_paren = {ui_top_font(), str8_lit(")"), ui_top_scheme()->text, ui_top_font_size(), 0, 0};
D_FancyString clse_paren = {ui_top_font(), str8_lit(")"), ui_top_palette()->text, ui_top_font_size(), 0, 0};
d_fancy_string_list_push(scratch.arena, &fancy_strings, &open_paren);
d_fancy_string_list_push(scratch.arena, &fancy_strings, &r_fstr);
d_fancy_string_list_push(scratch.arena, &fancy_strings, &comma);
@@ -367,7 +367,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
color_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "color_box");
UI_Parent(color_box) UI_PrefHeight(ui_em(1.875f, 1.f)) UI_Padding(ui_pct(1, 0))
{
UI_Scheme(ui_fork_top_color_scheme(.background = rgba)) UI_CornerRadius(ui_top_font_size()*0.5f)
UI_Palette(ui_build_palette(ui_top_palette(), .background = rgba)) UI_CornerRadius(ui_top_font_size()*0.5f)
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, ui_key_zero());
}
}
@@ -872,7 +872,7 @@ df_vr_bitmap_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_
internal UI_BOX_CUSTOM_DRAW(df_vr_bitmap_box_draw)
{
DF_VR_BitmapBoxDrawData *draw_data = (DF_VR_BitmapBoxDrawData *)user_data;
Vec4F32 bg_color = box->scheme->background;
Vec4F32 bg_color = box->palette->background;
d_img(box->rect, draw_data->src, draw_data->texture, v4f32(1, 1, 1, 1), 0, 0, 0);
if(draw_data->loaded_t < 0.98f)
{
+46 -46
View File
@@ -1641,23 +1641,23 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
}
////////////////////////
//- rjf: determine row's color scheme
//- rjf: determine row's color palette
//
UI_ColorScheme *scheme = ui_top_scheme();
UI_Palette *palette = ui_top_palette();
{
if(row_is_fresh)
{
scheme = ui_fork_top_color_scheme(.background = mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_Highlight0), v4f32(1, 1, 1, 0.2f)));
palette = ui_build_palette(ui_top_palette(), .background = mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_Highlight0), v4f32(1, 1, 1, 0.2f)));
}
}
////////////////////////
//- rjf: build row box
//
ui_set_next_palette(palette);
ui_set_next_flags(disabled_flags);
ui_set_next_pref_width(ui_pct(1, 0));
ui_set_next_pref_height(ui_px(scroll_list_params.row_height_px*row->size_in_rows, 1.f));
ui_set_next_scheme(scheme);
UI_Box *row_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom|UI_BoxFlag_RequireFocusBackground|UI_BoxFlag_Clickable, "row_%I64x", row_hash);
////////////////////////
@@ -1718,7 +1718,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
////////////////////////
//- rjf: build non-canvas row contents
//
if(!(row->flags & DF_EvalVizRowFlag_Canvas))
if(!(row->flags & DF_EvalVizRowFlag_Canvas)) UI_Parent(row_box) UI_HeightFill
{
////////////////////
//- rjf: draw start of cache lines in expansions
@@ -1731,7 +1731,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
ui_set_next_fixed_x(0);
ui_set_next_fixed_y(0);
ui_set_next_fixed_height(ui_top_font_size()*0.1f);
ui_set_next_scheme(ui_fork_top_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0)));
ui_build_box_from_key(UI_BoxFlag_Floating|UI_BoxFlag_DrawBackground, ui_key_zero());
}
@@ -1752,7 +1752,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
ui_set_next_fixed_height(ui_top_font_size()*1.f);
Vec4F32 boundary_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0);
boundary_color.w *= 0.25f;
ui_set_next_scheme(ui_fork_top_color_scheme(.background = boundary_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = boundary_color));
ui_build_box_from_key(UI_BoxFlag_Floating|UI_BoxFlag_DrawBackground, ui_key_zero());
}
}
@@ -1767,32 +1767,32 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x);
B32 can_edit_expr = !(row->depth > 0 || modifiable == 0);
// rjf: unpack scheme
UI_ColorScheme *scheme = ui_top_scheme();
// rjf: unpack palette
UI_Palette *palette = ui_top_palette();
{
if(row->flags & DF_EvalVizRowFlag_ExprIsSpecial)
{
scheme = ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText),
.background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground));
palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText),
.background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground));
}
}
// rjf: build
UI_Signal sig = {0};
B32 next_expanded = row_expanded;
UI_Scheme(scheme) UI_TableCell
UI_Palette(palette) UI_TableCell
UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off)
UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
{
B32 expr_editing_active = ui_is_focus_active();
B32 is_inherited = (row->inherited_type_key_chain.count != 0);
UI_Font(code_font) UI_Scheme(scheme) UI_FlagsAdd(row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0)
UI_Font(code_font) UI_Palette(palette) UI_FlagsAdd(row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0)
{
if(is_inherited)
{
Vec4F32 inherited_bg_color = df_rgba_from_theme_color(DF_ThemeColor_Highlight1);
inherited_bg_color.w *= 0.2f;
ui_set_next_scheme(ui_fork_top_color_scheme(.background = inherited_bg_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = inherited_bg_color));
}
FuzzyMatchRangeList matches = {0};
if(filter.size != 0)
@@ -1924,19 +1924,19 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
B32 value_is_complex = (!value_is_error && !value_is_hook && !(row->flags & DF_EvalVizRowFlag_CanEditValue));
B32 value_is_simple = (!value_is_error && !value_is_hook && (row->flags & DF_EvalVizRowFlag_CanEditValue));
// rjf: unpack scheme
UI_ColorScheme *scheme = ui_top_scheme();
// rjf: unpack palette
UI_Palette *palette = ui_top_palette();
{
if(row_is_bad)
{
scheme = ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText),
.background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground));
palette = ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeText),
.background = df_rgba_from_theme_color(DF_ThemeColor_SpecialNegativeBackground));
}
}
// rjf: build
UI_Signal sig = {0};
UI_Scheme(scheme) UI_TableCell UI_Font(code_font)
UI_Palette(palette) UI_TableCell UI_Font(code_font)
UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off)
UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
{
@@ -2129,7 +2129,7 @@ DF_VIEW_UI_FUNCTION_DEF(Empty)
UI_TextAlignment(UI_TextAlign_Center)
UI_PrefWidth(ui_em(15.f, 1.f))
UI_CornerRadius(ui_top_font_size()/2.f)
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative)
DF_Palette(DF_PaletteCode_SpecialNegative)
{
if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "Close Panel")))
{
@@ -2203,7 +2203,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted)
UI_TextAlignment(UI_TextAlign_Center)
UI_PrefWidth(ui_em(22.f, 1.f))
UI_CornerRadius(ui_top_font_size()/2.f)
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral)
DF_Palette(DF_PaletteCode_SpecialNeutral)
if(ui_clicked(df_icon_buttonf(DF_IconKind_Add, 0, "Add Target")))
{
DF_CmdParams params = df_cmd_params_from_view(ws, panel, view);
@@ -2225,7 +2225,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted)
UI_TextAlignment(UI_TextAlign_Center)
UI_PrefWidth(ui_em(22.f, 1.f))
UI_CornerRadius(ui_top_font_size()/2.f)
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral)
DF_Palette(DF_PaletteCode_SpecialNeutral)
{
if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch %S", target_name)))
{
@@ -3229,7 +3229,7 @@ DF_VIEW_UI_FUNCTION_DEF(EntityLister)
Vec4F32 color = df_rgba_from_entity(ent);
if(color.w != 0)
{
ui_set_next_scheme(ui_fork_top_color_scheme(.text = color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color));
}
UI_Box *name_label = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "%S##label_%p", display_string, ent);
ui_box_equip_fuzzy_match_ranges(name_label, &item.name_match_ranges);
@@ -3643,7 +3643,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target)
{
ui_label_multiline(ui_top_font_size()*30.f, str8_lit("By default, the debugger attempts to find a target's entry point with a set of default names, such as:"));
ui_spacer(ui_em(1.5f, 1.f));
UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_Scheme(ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure)))
UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeProcedure)))
{
ui_label(str8_lit("WinMain"));
ui_label(str8_lit("wWinMain"));
@@ -4741,21 +4741,21 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler)
{
B32 frozen_by_solo_mode = (entity->kind == DF_EntityKind_Thread && entity != df_entity_from_handle(ctrl_ctx.thread) && df_state->ctrl_solo_stepping_mode);
B32 frozen = df_entity_is_frozen(entity);
UI_ColorScheme *scheme = ui_top_scheme();
UI_Palette *palette = ui_top_palette();
if(frozen_by_solo_mode)
{
scheme = ui_fork_top_color_scheme(.background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0));
palette = ui_build_palette(ui_top_palette(), .background = df_rgba_from_theme_color(DF_ThemeColor_Highlight0));
}
else if(frozen)
{
scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialNegative);
palette = df_palette_from_code(DF_PaletteCode_SpecialNegative);
}
else
{
scheme = df_ui_color_scheme_from_code(DF_UIColorSchemeCode_SpecialPositive);
palette = df_palette_from_code(DF_PaletteCode_SpecialPositive);
}
UI_Signal sig = {0};
UI_Scheme(scheme) sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity);
UI_Palette(palette) sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity);
if(frozen_by_solo_mode && ui_hovering(sig)) UI_Tooltip
{
ui_label(str8_lit("This thread is frozen during stepping operations because it isn't selected, and Solo Stepping Mode is enabled."));
@@ -4809,7 +4809,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler)
}
UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 4) ? UI_FocusKind_On : UI_FocusKind_Off)
{
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative)
DF_Palette(DF_PaletteCode_SpecialNegative)
if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "###kill")))
{
DF_CmdParams params = df_cmd_params_from_view(ws, panel, view);
@@ -4864,7 +4864,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
Architecture arch = df_architecture_from_entity(thread);
DF_Entity *process = thread->parent;
Vec4F32 thread_color = ui_top_scheme()->text;
Vec4F32 thread_color = ui_top_palette()->text;
if(thread->flags & DF_EntityFlag_HasColor)
{
thread_color = df_rgba_from_entity(thread);
@@ -4983,7 +4983,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
ctrl_ctx.inline_unwind_count == frame->inline_unwind_idx)
{
selected_string = df_g_icon_kind_text_table[DF_IconKind_RightArrow];
ui_set_next_scheme(ui_fork_top_color_scheme(.text = thread_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = thread_color));
}
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|UI_BoxFlag_DrawText, "%S###selection_%i", selected_string,
(int)frame_idx);
@@ -5050,7 +5050,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
D_FancyStringList symbol_type_fstrs = df_fancy_string_list_from_code_string(scratch.arena, 0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), symbol_type_string);
D_FancyStringList fstrs = {0};
d_fancy_string_list_concat_in_place(&fstrs, &symbol_name_fstrs);
D_FancyString sep = {ui_top_font(), str8_lit(": "), ui_top_scheme()->colors[UI_ColorCode_TextWeak], ui_top_font_size()};
D_FancyString sep = {ui_top_font(), str8_lit(": "), ui_top_palette()->colors[UI_ColorCode_TextWeak], ui_top_font_size()};
d_fancy_string_list_push(scratch.arena, &fstrs, &sep);
d_fancy_string_list_concat_in_place(&fstrs, &symbol_type_fstrs);
UI_Box *label = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero());
@@ -5362,7 +5362,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules)
UI_FocusActive((txt_is_selected && mv->txt_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
UI_WidthFill
{
DF_UIColorScheme(dbgi_is_valid ? DF_UIColorSchemeCode_DefaultPositive : DF_UIColorSchemeCode_Default)
DF_Palette(dbgi_is_valid ? DF_PaletteCode_DefaultPositive : DF_PaletteCode_Default)
sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &mv->txt_cursor, &mv->txt_mark, mv->txt_buffer, sizeof(mv->txt_buffer), &mv->txt_size, 0, dbgi_path, "###dbg_path_%p", entity);
edit_commit = (edit_commit || ui_committed(sig));
}
@@ -6029,7 +6029,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_em(3, 1))
UI_Row UI_Padding(ui_pct(1, 0))
UI_PrefWidth(ui_text_dim(10, 1))
DF_UIColorScheme(DF_UIColorSchemeCode_DefaultNegative)
DF_Palette(DF_PaletteCode_DefaultNegative)
{
UI_Font(ui_icon_font()) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]);
ui_labelf("Could not find \"%S\".", full_path);
@@ -6040,7 +6040,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
UI_CornerRadius(ui_top_font_size()/3)
UI_PrefWidth(ui_text_dim(10, 1))
UI_Focus(UI_FocusKind_On)
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNeutral)
DF_Palette(DF_PaletteCode_SpecialNeutral)
if(ui_clicked(ui_buttonf("Find alternative...")))
{
DF_CmdParams params = df_cmd_params_from_view(ws, panel, view);
@@ -6582,7 +6582,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
if(file_is_out_of_date)
{
UI_Box *box = &ui_g_nil_box;
DF_UIColorScheme(DF_UIColorSchemeCode_SpecialNegative)
DF_Palette(DF_PaletteCode_SpecialNegative)
UI_Font(df_font_from_slot(DF_FontSlot_Icons))
{
box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "%S###file_ood_warning", df_g_icon_kind_text_table[DF_IconKind_WarningBig]);
@@ -6593,7 +6593,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(1, 1))
{
ui_labelf("This file has changed since ", out_of_date_dbgi_name);
UI_Scheme(ui_fork_top_color_scheme(.text = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))) ui_label(out_of_date_dbgi_name);
UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_Highlight0))) ui_label(out_of_date_dbgi_name);
ui_labelf(" was produced.");
}
}
@@ -8973,7 +8973,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory)
{
if(global_byte_idx == a->vaddr_range.min) UI_Parent(row_overlay_box)
{
ui_set_next_scheme(ui_fork_top_color_scheme(.background = annotation->color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = annotation->color));
ui_set_next_fixed_x(big_glyph_advance*18.f + col_idx*cell_width_px + -cell_width_px/8.f + off);
ui_set_next_fixed_y((row_idx-viz_range_rows.min)*row_height_px + -cell_width_px/8.f);
ui_set_next_fixed_width(cell_width_px/4.f);
@@ -9678,9 +9678,9 @@ DF_VIEW_UI_FUNCTION_DEF(Theme)
Vec4F32 bg_color = colors[DF_ThemeColor_DefaultBackground];
Vec4F32 tx_color = colors[DF_ThemeColor_DefaultText];
Vec4F32 bd_color = colors[DF_ThemeColor_DefaultBorder];
ui_set_next_scheme(ui_fork_top_color_scheme(.text = tx_color,
.border = bd_color,
.background = bg_color));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = tx_color,
.border = bd_color,
.background = bg_color));
if(ui_clicked(ui_buttonf("%S", df_g_theme_preset_display_string_table[preset])))
{
MemoryCopy(df_gfx_state->cfg_theme_target.colors, colors, sizeof(df_gfx_state->cfg_theme_target.colors));
@@ -9933,15 +9933,15 @@ DF_VIEW_UI_FUNCTION_DEF(Theme)
"###color_%I64x", (U64)color);
UI_Parent(color_row)
{
Vec4F32 bg_color = ui_top_scheme()->background;
Vec4F32 default_text_color = ui_top_scheme()->text;
Vec4F32 bg_color = ui_top_palette()->background;
Vec4F32 default_text_color = ui_top_palette()->text;
F32 default_fallback_factor = clamp_1f32(r1f32(0.3f, 1), dot_4f32(normalize_4f32(rgba), normalize_4f32(bg_color))) - 0.3f;
Vec4F32 text_rgba = mix_4f32(rgba, default_text_color, default_fallback_factor);
UI_WidthFill UI_Scheme(ui_fork_top_color_scheme(.text = text_rgba)) ui_label(df_g_theme_color_display_string_table[color]);
UI_WidthFill UI_Palette(ui_build_palette(ui_top_palette(), .text = text_rgba)) ui_label(df_g_theme_color_display_string_table[color]);
ui_set_next_pref_width(ui_top_pref_height());
UI_HeightFill UI_Column UI_Padding(ui_em(0.3f, 1))
{
ui_set_next_scheme(ui_fork_top_color_scheme(.background = rgba));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba));
ui_set_next_corner_radius_00(ui_top_font_size()/4.f);
ui_set_next_corner_radius_01(ui_top_font_size()/4.f);
ui_set_next_corner_radius_10(ui_top_font_size()/4.f);
+12 -6
View File
@@ -17,11 +17,12 @@
#define UI_FocusActive(v) DeferLoop(ui_push_focus_active(v), ui_pop_focus_active())
#define UI_FastpathCodepoint(v) DeferLoop(ui_push_fastpath_codepoint(v), ui_pop_fastpath_codepoint())
#define UI_Transparency(v) DeferLoop(ui_push_transparency(v), ui_pop_transparency())
#define UI_Scheme(v) DeferLoop(ui_push_scheme(v), ui_pop_scheme())
#define UI_Palette(v) DeferLoop(ui_push_palette(v), ui_pop_palette())
#define UI_Squish(v) DeferLoop(ui_push_squish(v), ui_pop_squish())
#define UI_HoverCursor(v) DeferLoop(ui_push_hover_cursor(v), ui_pop_hover_cursor())
#define UI_Font(v) DeferLoop(ui_push_font(v), ui_pop_font())
#define UI_FontSize(v) DeferLoop(ui_push_font_size(v), ui_pop_font_size())
#define UI_RunFlags(v) DeferLoop(ui_push_run_flags(v), ui_pop_run_flags())
#define UI_TabSize(v) DeferLoop(ui_push_tab_size(v), ui_pop_tab_size())
#define UI_CornerRadius00(v) DeferLoop(ui_push_corner_radius_00(v), ui_pop_corner_radius_00())
#define UI_CornerRadius01(v) DeferLoop(ui_push_corner_radius_01(v), ui_pop_corner_radius_01())
@@ -44,11 +45,12 @@ internal UI_FocusKind ui_top_focus_hot(void) { UI_StackTopImpl(ui_state, FocusHo
internal UI_FocusKind ui_top_focus_active(void) { UI_StackTopImpl(ui_state, FocusActive, focus_active) }
internal U32 ui_top_fastpath_codepoint(void) { UI_StackTopImpl(ui_state, FastpathCodepoint, fastpath_codepoint) }
internal F32 ui_top_transparency(void) { UI_StackTopImpl(ui_state, Transparency, transparency) }
internal UI_ColorScheme* ui_top_scheme(void) { UI_StackTopImpl(ui_state, Scheme, scheme) }
internal UI_Palette* ui_top_palette(void) { UI_StackTopImpl(ui_state, Palette, palette) }
internal F32 ui_top_squish(void) { UI_StackTopImpl(ui_state, Squish, squish) }
internal OS_Cursor ui_top_hover_cursor(void) { UI_StackTopImpl(ui_state, HoverCursor, hover_cursor) }
internal F_Tag ui_top_font(void) { UI_StackTopImpl(ui_state, Font, font) }
internal F32 ui_top_font_size(void) { UI_StackTopImpl(ui_state, FontSize, font_size) }
internal F_RunFlags ui_top_run_flags(void) { UI_StackTopImpl(ui_state, RunFlags, run_flags) }
internal F32 ui_top_tab_size(void) { UI_StackTopImpl(ui_state, TabSize, tab_size) }
internal F32 ui_top_corner_radius_00(void) { UI_StackTopImpl(ui_state, CornerRadius00, corner_radius_00) }
internal F32 ui_top_corner_radius_01(void) { UI_StackTopImpl(ui_state, CornerRadius01, corner_radius_01) }
@@ -70,11 +72,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void) { UI_StackBottomImpl(ui_state, F
internal UI_FocusKind ui_bottom_focus_active(void) { UI_StackBottomImpl(ui_state, FocusActive, focus_active) }
internal U32 ui_bottom_fastpath_codepoint(void) { UI_StackBottomImpl(ui_state, FastpathCodepoint, fastpath_codepoint) }
internal F32 ui_bottom_transparency(void) { UI_StackBottomImpl(ui_state, Transparency, transparency) }
internal UI_ColorScheme* ui_bottom_scheme(void) { UI_StackBottomImpl(ui_state, Scheme, scheme) }
internal UI_Palette* ui_bottom_palette(void) { UI_StackBottomImpl(ui_state, Palette, palette) }
internal F32 ui_bottom_squish(void) { UI_StackBottomImpl(ui_state, Squish, squish) }
internal OS_Cursor ui_bottom_hover_cursor(void) { UI_StackBottomImpl(ui_state, HoverCursor, hover_cursor) }
internal F_Tag ui_bottom_font(void) { UI_StackBottomImpl(ui_state, Font, font) }
internal F32 ui_bottom_font_size(void) { UI_StackBottomImpl(ui_state, FontSize, font_size) }
internal F_RunFlags ui_bottom_run_flags(void) { UI_StackBottomImpl(ui_state, RunFlags, run_flags) }
internal F32 ui_bottom_tab_size(void) { UI_StackBottomImpl(ui_state, TabSize, tab_size) }
internal F32 ui_bottom_corner_radius_00(void) { UI_StackBottomImpl(ui_state, CornerRadius00, corner_radius_00) }
internal F32 ui_bottom_corner_radius_01(void) { UI_StackBottomImpl(ui_state, CornerRadius01, corner_radius_01) }
@@ -96,11 +99,12 @@ internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v) { UI_StackPushImpl(ui_st
internal UI_FocusKind ui_push_focus_active(UI_FocusKind v) { UI_StackPushImpl(ui_state, FocusActive, focus_active, UI_FocusKind, v) }
internal U32 ui_push_fastpath_codepoint(U32 v) { UI_StackPushImpl(ui_state, FastpathCodepoint, fastpath_codepoint, U32, v) }
internal F32 ui_push_transparency(F32 v) { UI_StackPushImpl(ui_state, Transparency, transparency, F32, v) }
internal UI_ColorScheme* ui_push_scheme(UI_ColorScheme* v) { UI_StackPushImpl(ui_state, Scheme, scheme, UI_ColorScheme*, v) }
internal UI_Palette* ui_push_palette(UI_Palette* v) { UI_StackPushImpl(ui_state, Palette, palette, UI_Palette* , v) }
internal F32 ui_push_squish(F32 v) { UI_StackPushImpl(ui_state, Squish, squish, F32, v) }
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v) { UI_StackPushImpl(ui_state, HoverCursor, hover_cursor, OS_Cursor, v) }
internal F_Tag ui_push_font(F_Tag v) { UI_StackPushImpl(ui_state, Font, font, F_Tag, v) }
internal F32 ui_push_font_size(F32 v) { UI_StackPushImpl(ui_state, FontSize, font_size, F32, v) }
internal F_RunFlags ui_push_run_flags(F_RunFlags v) { UI_StackPushImpl(ui_state, RunFlags, run_flags, F_RunFlags, v) }
internal F32 ui_push_tab_size(F32 v) { UI_StackPushImpl(ui_state, TabSize, tab_size, F32, v) }
internal F32 ui_push_corner_radius_00(F32 v) { UI_StackPushImpl(ui_state, CornerRadius00, corner_radius_00, F32, v) }
internal F32 ui_push_corner_radius_01(F32 v) { UI_StackPushImpl(ui_state, CornerRadius01, corner_radius_01, F32, v) }
@@ -122,11 +126,12 @@ internal UI_FocusKind ui_pop_focus_hot(void) { UI_StackPopImpl(ui_state, FocusHo
internal UI_FocusKind ui_pop_focus_active(void) { UI_StackPopImpl(ui_state, FocusActive, focus_active) }
internal U32 ui_pop_fastpath_codepoint(void) { UI_StackPopImpl(ui_state, FastpathCodepoint, fastpath_codepoint) }
internal F32 ui_pop_transparency(void) { UI_StackPopImpl(ui_state, Transparency, transparency) }
internal UI_ColorScheme* ui_pop_scheme(void) { UI_StackPopImpl(ui_state, Scheme, scheme) }
internal UI_Palette* ui_pop_palette(void) { UI_StackPopImpl(ui_state, Palette, palette) }
internal F32 ui_pop_squish(void) { UI_StackPopImpl(ui_state, Squish, squish) }
internal OS_Cursor ui_pop_hover_cursor(void) { UI_StackPopImpl(ui_state, HoverCursor, hover_cursor) }
internal F_Tag ui_pop_font(void) { UI_StackPopImpl(ui_state, Font, font) }
internal F32 ui_pop_font_size(void) { UI_StackPopImpl(ui_state, FontSize, font_size) }
internal F_RunFlags ui_pop_run_flags(void) { UI_StackPopImpl(ui_state, RunFlags, run_flags) }
internal F32 ui_pop_tab_size(void) { UI_StackPopImpl(ui_state, TabSize, tab_size) }
internal F32 ui_pop_corner_radius_00(void) { UI_StackPopImpl(ui_state, CornerRadius00, corner_radius_00) }
internal F32 ui_pop_corner_radius_01(void) { UI_StackPopImpl(ui_state, CornerRadius01, corner_radius_01) }
@@ -148,11 +153,12 @@ internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v) { UI_StackSetNextImp
internal UI_FocusKind ui_set_next_focus_active(UI_FocusKind v) { UI_StackSetNextImpl(ui_state, FocusActive, focus_active, UI_FocusKind, v) }
internal U32 ui_set_next_fastpath_codepoint(U32 v) { UI_StackSetNextImpl(ui_state, FastpathCodepoint, fastpath_codepoint, U32, v) }
internal F32 ui_set_next_transparency(F32 v) { UI_StackSetNextImpl(ui_state, Transparency, transparency, F32, v) }
internal UI_ColorScheme* ui_set_next_scheme(UI_ColorScheme* v) { UI_StackSetNextImpl(ui_state, Scheme, scheme, UI_ColorScheme*, v) }
internal UI_Palette* ui_set_next_palette(UI_Palette* v) { UI_StackSetNextImpl(ui_state, Palette, palette, UI_Palette* , v) }
internal F32 ui_set_next_squish(F32 v) { UI_StackSetNextImpl(ui_state, Squish, squish, F32, v) }
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v) { UI_StackSetNextImpl(ui_state, HoverCursor, hover_cursor, OS_Cursor, v) }
internal F_Tag ui_set_next_font(F_Tag v) { UI_StackSetNextImpl(ui_state, Font, font, F_Tag, v) }
internal F32 ui_set_next_font_size(F32 v) { UI_StackSetNextImpl(ui_state, FontSize, font_size, F32, v) }
internal F_RunFlags ui_set_next_run_flags(F_RunFlags v) { UI_StackSetNextImpl(ui_state, RunFlags, run_flags, F_RunFlags, v) }
internal F32 ui_set_next_tab_size(F32 v) { UI_StackSetNextImpl(ui_state, TabSize, tab_size, F32, v) }
internal F32 ui_set_next_corner_radius_00(F32 v) { UI_StackSetNextImpl(ui_state, CornerRadius00, corner_radius_00, F32, v) }
internal F32 ui_set_next_corner_radius_01(F32 v) { UI_StackSetNextImpl(ui_state, CornerRadius01, corner_radius_01, F32, v) }
+22 -11
View File
@@ -19,11 +19,12 @@ typedef struct UI_FocusHotNode UI_FocusHotNode; struct UI_FocusHotNode{UI_FocusH
typedef struct UI_FocusActiveNode UI_FocusActiveNode; struct UI_FocusActiveNode{UI_FocusActiveNode *next; UI_FocusKind v;};
typedef struct UI_FastpathCodepointNode UI_FastpathCodepointNode; struct UI_FastpathCodepointNode{UI_FastpathCodepointNode *next; U32 v;};
typedef struct UI_TransparencyNode UI_TransparencyNode; struct UI_TransparencyNode{UI_TransparencyNode *next; F32 v;};
typedef struct UI_SchemeNode UI_SchemeNode; struct UI_SchemeNode{UI_SchemeNode *next; UI_ColorScheme* v;};
typedef struct UI_PaletteNode UI_PaletteNode; struct UI_PaletteNode{UI_PaletteNode *next; UI_Palette* v;};
typedef struct UI_SquishNode UI_SquishNode; struct UI_SquishNode{UI_SquishNode *next; F32 v;};
typedef struct UI_HoverCursorNode UI_HoverCursorNode; struct UI_HoverCursorNode{UI_HoverCursorNode *next; OS_Cursor v;};
typedef struct UI_FontNode UI_FontNode; struct UI_FontNode{UI_FontNode *next; F_Tag v;};
typedef struct UI_FontSizeNode UI_FontSizeNode; struct UI_FontSizeNode{UI_FontSizeNode *next; F32 v;};
typedef struct UI_RunFlagsNode UI_RunFlagsNode; struct UI_RunFlagsNode{UI_RunFlagsNode *next; F_RunFlags v;};
typedef struct UI_TabSizeNode UI_TabSizeNode; struct UI_TabSizeNode{UI_TabSizeNode *next; F32 v;};
typedef struct UI_CornerRadius00Node UI_CornerRadius00Node; struct UI_CornerRadius00Node{UI_CornerRadius00Node *next; F32 v;};
typedef struct UI_CornerRadius01Node UI_CornerRadius01Node; struct UI_CornerRadius01Node{UI_CornerRadius01Node *next; F32 v;};
@@ -48,11 +49,12 @@ UI_FocusHotNode focus_hot_nil_stack_top;\
UI_FocusActiveNode focus_active_nil_stack_top;\
UI_FastpathCodepointNode fastpath_codepoint_nil_stack_top;\
UI_TransparencyNode transparency_nil_stack_top;\
UI_SchemeNode scheme_nil_stack_top;\
UI_PaletteNode palette_nil_stack_top;\
UI_SquishNode squish_nil_stack_top;\
UI_HoverCursorNode hover_cursor_nil_stack_top;\
UI_FontNode font_nil_stack_top;\
UI_FontSizeNode font_size_nil_stack_top;\
UI_RunFlagsNode run_flags_nil_stack_top;\
UI_TabSizeNode tab_size_nil_stack_top;\
UI_CornerRadius00Node corner_radius_00_nil_stack_top;\
UI_CornerRadius01Node corner_radius_01_nil_stack_top;\
@@ -76,11 +78,12 @@ state->focus_hot_nil_stack_top.v = UI_FocusKind_Null;\
state->focus_active_nil_stack_top.v = UI_FocusKind_Null;\
state->fastpath_codepoint_nil_stack_top.v = 0;\
state->transparency_nil_stack_top.v = 0;\
state->scheme_nil_stack_top.v = &ui_g_nil_color_scheme;\
state->palette_nil_stack_top.v = &ui_g_nil_palette;\
state->squish_nil_stack_top.v = 0;\
state->hover_cursor_nil_stack_top.v = OS_Cursor_Pointer;\
state->font_nil_stack_top.v = f_tag_zero();\
state->font_size_nil_stack_top.v = 24.f;\
state->run_flags_nil_stack_top.v = 0;\
state->tab_size_nil_stack_top.v = 24.f*4.f;\
state->corner_radius_00_nil_stack_top.v = 0;\
state->corner_radius_01_nil_stack_top.v = 0;\
@@ -106,11 +109,12 @@ struct { UI_FocusHotNode *top; UI_FocusKind bottom_val; UI_FocusHotNode *free; B
struct { UI_FocusActiveNode *top; UI_FocusKind bottom_val; UI_FocusActiveNode *free; B32 auto_pop; } focus_active_stack;\
struct { UI_FastpathCodepointNode *top; U32 bottom_val; UI_FastpathCodepointNode *free; B32 auto_pop; } fastpath_codepoint_stack;\
struct { UI_TransparencyNode *top; F32 bottom_val; UI_TransparencyNode *free; B32 auto_pop; } transparency_stack;\
struct { UI_SchemeNode *top; UI_ColorScheme* bottom_val; UI_SchemeNode *free; B32 auto_pop; } scheme_stack;\
struct { UI_PaletteNode *top; UI_Palette* bottom_val; UI_PaletteNode *free; B32 auto_pop; } palette_stack;\
struct { UI_SquishNode *top; F32 bottom_val; UI_SquishNode *free; B32 auto_pop; } squish_stack;\
struct { UI_HoverCursorNode *top; OS_Cursor bottom_val; UI_HoverCursorNode *free; B32 auto_pop; } hover_cursor_stack;\
struct { UI_FontNode *top; F_Tag bottom_val; UI_FontNode *free; B32 auto_pop; } font_stack;\
struct { UI_FontSizeNode *top; F32 bottom_val; UI_FontSizeNode *free; B32 auto_pop; } font_size_stack;\
struct { UI_RunFlagsNode *top; F_RunFlags bottom_val; UI_RunFlagsNode *free; B32 auto_pop; } run_flags_stack;\
struct { UI_TabSizeNode *top; F32 bottom_val; UI_TabSizeNode *free; B32 auto_pop; } tab_size_stack;\
struct { UI_CornerRadius00Node *top; F32 bottom_val; UI_CornerRadius00Node *free; B32 auto_pop; } corner_radius_00_stack;\
struct { UI_CornerRadius01Node *top; F32 bottom_val; UI_CornerRadius01Node *free; B32 auto_pop; } corner_radius_01_stack;\
@@ -134,11 +138,12 @@ state->focus_hot_stack.top = &state->focus_hot_nil_stack_top; state->focus_hot_s
state->focus_active_stack.top = &state->focus_active_nil_stack_top; state->focus_active_stack.bottom_val = UI_FocusKind_Null; state->focus_active_stack.free = 0; state->focus_active_stack.auto_pop = 0;\
state->fastpath_codepoint_stack.top = &state->fastpath_codepoint_nil_stack_top; state->fastpath_codepoint_stack.bottom_val = 0; state->fastpath_codepoint_stack.free = 0; state->fastpath_codepoint_stack.auto_pop = 0;\
state->transparency_stack.top = &state->transparency_nil_stack_top; state->transparency_stack.bottom_val = 0; state->transparency_stack.free = 0; state->transparency_stack.auto_pop = 0;\
state->scheme_stack.top = &state->scheme_nil_stack_top; state->scheme_stack.bottom_val = &ui_g_nil_color_scheme; state->scheme_stack.free = 0; state->scheme_stack.auto_pop = 0;\
state->palette_stack.top = &state->palette_nil_stack_top; state->palette_stack.bottom_val = &ui_g_nil_palette; state->palette_stack.free = 0; state->palette_stack.auto_pop = 0;\
state->squish_stack.top = &state->squish_nil_stack_top; state->squish_stack.bottom_val = 0; state->squish_stack.free = 0; state->squish_stack.auto_pop = 0;\
state->hover_cursor_stack.top = &state->hover_cursor_nil_stack_top; state->hover_cursor_stack.bottom_val = OS_Cursor_Pointer; state->hover_cursor_stack.free = 0; state->hover_cursor_stack.auto_pop = 0;\
state->font_stack.top = &state->font_nil_stack_top; state->font_stack.bottom_val = f_tag_zero(); state->font_stack.free = 0; state->font_stack.auto_pop = 0;\
state->font_size_stack.top = &state->font_size_nil_stack_top; state->font_size_stack.bottom_val = 24.f; state->font_size_stack.free = 0; state->font_size_stack.auto_pop = 0;\
state->run_flags_stack.top = &state->run_flags_nil_stack_top; state->run_flags_stack.bottom_val = 0; state->run_flags_stack.free = 0; state->run_flags_stack.auto_pop = 0;\
state->tab_size_stack.top = &state->tab_size_nil_stack_top; state->tab_size_stack.bottom_val = 24.f*4.f; state->tab_size_stack.free = 0; state->tab_size_stack.auto_pop = 0;\
state->corner_radius_00_stack.top = &state->corner_radius_00_nil_stack_top; state->corner_radius_00_stack.bottom_val = 0; state->corner_radius_00_stack.free = 0; state->corner_radius_00_stack.auto_pop = 0;\
state->corner_radius_01_stack.top = &state->corner_radius_01_nil_stack_top; state->corner_radius_01_stack.bottom_val = 0; state->corner_radius_01_stack.free = 0; state->corner_radius_01_stack.auto_pop = 0;\
@@ -162,11 +167,12 @@ if(state->focus_hot_stack.auto_pop) { ui_pop_focus_hot(); state->focus_hot_stack
if(state->focus_active_stack.auto_pop) { ui_pop_focus_active(); state->focus_active_stack.auto_pop = 0; }\
if(state->fastpath_codepoint_stack.auto_pop) { ui_pop_fastpath_codepoint(); state->fastpath_codepoint_stack.auto_pop = 0; }\
if(state->transparency_stack.auto_pop) { ui_pop_transparency(); state->transparency_stack.auto_pop = 0; }\
if(state->scheme_stack.auto_pop) { ui_pop_scheme(); state->scheme_stack.auto_pop = 0; }\
if(state->palette_stack.auto_pop) { ui_pop_palette(); state->palette_stack.auto_pop = 0; }\
if(state->squish_stack.auto_pop) { ui_pop_squish(); state->squish_stack.auto_pop = 0; }\
if(state->hover_cursor_stack.auto_pop) { ui_pop_hover_cursor(); state->hover_cursor_stack.auto_pop = 0; }\
if(state->font_stack.auto_pop) { ui_pop_font(); state->font_stack.auto_pop = 0; }\
if(state->font_size_stack.auto_pop) { ui_pop_font_size(); state->font_size_stack.auto_pop = 0; }\
if(state->run_flags_stack.auto_pop) { ui_pop_run_flags(); state->run_flags_stack.auto_pop = 0; }\
if(state->tab_size_stack.auto_pop) { ui_pop_tab_size(); state->tab_size_stack.auto_pop = 0; }\
if(state->corner_radius_00_stack.auto_pop) { ui_pop_corner_radius_00(); state->corner_radius_00_stack.auto_pop = 0; }\
if(state->corner_radius_01_stack.auto_pop) { ui_pop_corner_radius_01(); state->corner_radius_01_stack.auto_pop = 0; }\
@@ -189,11 +195,12 @@ internal UI_FocusKind ui_top_focus_hot(void);
internal UI_FocusKind ui_top_focus_active(void);
internal U32 ui_top_fastpath_codepoint(void);
internal F32 ui_top_transparency(void);
internal UI_ColorScheme* ui_top_scheme(void);
internal UI_Palette* ui_top_palette(void);
internal F32 ui_top_squish(void);
internal OS_Cursor ui_top_hover_cursor(void);
internal F_Tag ui_top_font(void);
internal F32 ui_top_font_size(void);
internal F_RunFlags ui_top_run_flags(void);
internal F32 ui_top_tab_size(void);
internal F32 ui_top_corner_radius_00(void);
internal F32 ui_top_corner_radius_01(void);
@@ -215,11 +222,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void);
internal UI_FocusKind ui_bottom_focus_active(void);
internal U32 ui_bottom_fastpath_codepoint(void);
internal F32 ui_bottom_transparency(void);
internal UI_ColorScheme* ui_bottom_scheme(void);
internal UI_Palette* ui_bottom_palette(void);
internal F32 ui_bottom_squish(void);
internal OS_Cursor ui_bottom_hover_cursor(void);
internal F_Tag ui_bottom_font(void);
internal F32 ui_bottom_font_size(void);
internal F_RunFlags ui_bottom_run_flags(void);
internal F32 ui_bottom_tab_size(void);
internal F32 ui_bottom_corner_radius_00(void);
internal F32 ui_bottom_corner_radius_01(void);
@@ -241,11 +249,12 @@ internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v);
internal UI_FocusKind ui_push_focus_active(UI_FocusKind v);
internal U32 ui_push_fastpath_codepoint(U32 v);
internal F32 ui_push_transparency(F32 v);
internal UI_ColorScheme* ui_push_scheme(UI_ColorScheme* v);
internal UI_Palette* ui_push_palette(UI_Palette* v);
internal F32 ui_push_squish(F32 v);
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v);
internal F_Tag ui_push_font(F_Tag v);
internal F32 ui_push_font_size(F32 v);
internal F_RunFlags ui_push_run_flags(F_RunFlags v);
internal F32 ui_push_tab_size(F32 v);
internal F32 ui_push_corner_radius_00(F32 v);
internal F32 ui_push_corner_radius_01(F32 v);
@@ -267,11 +276,12 @@ internal UI_FocusKind ui_pop_focus_hot(void);
internal UI_FocusKind ui_pop_focus_active(void);
internal U32 ui_pop_fastpath_codepoint(void);
internal F32 ui_pop_transparency(void);
internal UI_ColorScheme* ui_pop_scheme(void);
internal UI_Palette* ui_pop_palette(void);
internal F32 ui_pop_squish(void);
internal OS_Cursor ui_pop_hover_cursor(void);
internal F_Tag ui_pop_font(void);
internal F32 ui_pop_font_size(void);
internal F_RunFlags ui_pop_run_flags(void);
internal F32 ui_pop_tab_size(void);
internal F32 ui_pop_corner_radius_00(void);
internal F32 ui_pop_corner_radius_01(void);
@@ -293,11 +303,12 @@ internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v);
internal UI_FocusKind ui_set_next_focus_active(UI_FocusKind v);
internal U32 ui_set_next_fastpath_codepoint(U32 v);
internal F32 ui_set_next_transparency(F32 v);
internal UI_ColorScheme* ui_set_next_scheme(UI_ColorScheme* v);
internal UI_Palette* ui_set_next_palette(UI_Palette* v);
internal F32 ui_set_next_squish(F32 v);
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v);
internal F_Tag ui_set_next_font(F_Tag v);
internal F32 ui_set_next_font_size(F32 v);
internal F_RunFlags ui_set_next_run_flags(F_RunFlags v);
internal F32 ui_set_next_tab_size(F32 v);
internal F32 ui_set_next_corner_radius_00(F32 v);
internal F32 ui_set_next_corner_radius_01(F32 v);
+2 -1
View File
@@ -30,7 +30,7 @@ UI_StackTable:
//- rjf: colors
{ Transparency transparency F32 0 }
{ Scheme scheme `UI_ColorScheme*` `&ui_g_nil_color_scheme` }
{ Palette palette `UI_Palette* ` `&ui_g_nil_palette` }
//- rjf: squish
{ Squish squish F32 0 }
@@ -41,6 +41,7 @@ UI_StackTable:
//- rjf: font
{ Font font F_Tag `f_tag_zero()` }
{ FontSize font_size F32 24.f }
{ RunFlags run_flags F_RunFlags 0 }
{ TabSize tab_size F32 `24.f*4.f` }
//- rjf: corner radii
+4 -5
View File
@@ -130,9 +130,9 @@ internal UI_BOX_CUSTOM_DRAW(ui_line_edit_draw)
F_Tag font = box->font;
F32 font_size = box->font_size;
F32 tab_size = box->tab_size;
Vec4F32 cursor_color = box->scheme->colors[UI_ColorCode_Cursor];
Vec4F32 cursor_color = box->palette->colors[UI_ColorCode_Cursor];
cursor_color.w *= box->parent->parent->focus_active_t;
Vec4F32 select_color = box->scheme->colors[UI_ColorCode_Selection];
Vec4F32 select_color = box->palette->colors[UI_ColorCode_Selection];
select_color.w *= (box->parent->parent->focus_active_t*0.2f + 0.8f);
Vec2F32 text_position = ui_box_text_position(box);
String8 edited_string = draw_data->edited_string;
@@ -478,7 +478,7 @@ ui_do_color_tooltip_hsv(Vec3F32 hsv)
{
UI_PrefWidth(ui_em(22.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f)) UI_Row UI_Padding(ui_pct(1, 0))
{
UI_Scheme(ui_fork_top_color_scheme(.background = v4f32(rgb.x, rgb.y, rgb.z, 1.f)))
UI_Palette(ui_build_palette(ui_top_palette(), .background = v4f32(rgb.x, rgb.y, rgb.z, 1.f)))
UI_CornerRadius(4.f)
UI_PrefWidth(ui_em(6.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f))
ui_build_box_from_string(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, str8_lit(""));
@@ -517,7 +517,7 @@ ui_do_color_tooltip_hsva(Vec4F32 hsva)
{
UI_PrefWidth(ui_em(22.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f)) UI_Row UI_Padding(ui_pct(1, 0))
{
UI_Scheme(ui_fork_top_color_scheme(.background = rgba))
UI_Palette(ui_build_palette(ui_top_palette(), .background = rgba))
UI_CornerRadius(4.f)
UI_PrefWidth(ui_em(6.f, 1.f)) UI_PrefHeight(ui_em(6.f, 1.f))
ui_build_box_from_string(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground, str8_lit(""));
@@ -1064,7 +1064,6 @@ ui_table_vector_end(void)
internal UI_Box *
ui_table_cell_begin(void)
{
UI_Box *vector = ui_top_parent();
U64 column_idx = ui_ts_cell_idx;
F32 width_pct = column_idx < ui_ts_col_pct_count ? ui_ts_col_pcts_stable[column_idx] : 1.f;
return ui_table_cell_sized_begin(ui_pct(width_pct, 0));
+19 -30
View File
@@ -1442,7 +1442,7 @@ ui_end_build(void)
Min(text_pos.x+drawn_text_dim.x, rect.x1),
rect.y1),
ui_state->mouse);
if(text_is_truncated && mouse_is_hovering)
if(text_is_truncated && mouse_is_hovering && !(b->flags & UI_BoxFlag_DisableTruncatedHover))
{
if(!str8_match(box_display_string, ui_state->string_hover_string, 0))
{
@@ -1890,7 +1890,7 @@ ui_begin_ctx_menu(UI_Key key)
ui_state->ctx_menu_root->flags |= UI_BoxFlag_Clip;
ui_state->ctx_menu_root->flags |= UI_BoxFlag_Clickable;
ui_state->ctx_menu_root->corner_radii[Corner_00] = ui_state->ctx_menu_root->corner_radii[Corner_01] = ui_state->ctx_menu_root->corner_radii[Corner_10] = ui_state->ctx_menu_root->corner_radii[Corner_11] = ui_top_font_size()*0.25f;
ui_state->ctx_menu_root->scheme = ui_top_scheme();
ui_state->ctx_menu_root->palette = ui_top_palette();
ui_state->ctx_menu_root->blur_size = ui_top_blur_size();
}
ui_push_pref_width(ui_bottom_pref_width());
@@ -2036,21 +2036,16 @@ ui_set_auto_focus_hot_key(UI_Key key)
}
}
//- rjf: color scheme forming
//- rjf: palette forming
internal UI_ColorScheme *
ui_push_color_scheme_(UI_ColorScheme *params)
internal UI_Palette *
ui_build_palette_(UI_Palette *base, UI_Palette *overrides)
{
UI_ColorScheme *scheme = push_array(ui_build_arena(), UI_ColorScheme, 1);
MemoryCopyStruct(scheme, params);
return scheme;
}
internal UI_ColorScheme *
ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides)
{
UI_ColorScheme *fork = push_array(ui_build_arena(), UI_ColorScheme, 1);
MemoryCopyStruct(fork, scheme);
UI_Palette *palette = push_array(ui_build_arena(), UI_Palette, 1);
if(base != 0)
{
MemoryCopyStruct(palette, base);
}
for(EachEnumVal(UI_ColorCode, code))
{
if(overrides->colors[code].x != 0 ||
@@ -2058,17 +2053,10 @@ ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides)
overrides->colors[code].z != 0 ||
overrides->colors[code].w != 0)
{
fork->colors[code] = overrides->colors[code];
palette->colors[code] = overrides->colors[code];
}
}
return fork;
}
internal UI_ColorScheme *
ui_fork_top_color_scheme_(UI_ColorScheme *params)
{
UI_ColorScheme *scheme = ui_fork_color_scheme_(ui_top_scheme(), params);
return scheme;
return palette;
}
//- rjf: box node construction
@@ -2215,7 +2203,7 @@ ui_build_box_from_key(UI_BoxFlags flags, UI_Key key)
box->text_align = ui_state->text_alignment_stack.top->v;
box->child_layout_axis = ui_state->child_layout_axis_stack.top->v;
box->scheme = ui_state->scheme_stack.top->v;
box->palette = ui_state->palette_stack.top->v;
box->font = ui_state->font_stack.top->v;
box->font_size = ui_state->font_size_stack.top->v;
box->tab_size = ui_state->tab_size_stack.top->v;
@@ -2302,10 +2290,11 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
ProfBeginFunction();
box->string = push_str8_copy(ui_build_arena(), string);
box->flags |= UI_BoxFlag_HasDisplayString;
UI_ColorCode text_color_code = (box->flags & UI_BoxFlag_DrawTextWeak ? UI_ColorCode_TextWeak : UI_ColorCode_Text);
if(box->flags & UI_BoxFlag_DrawText && (box->fastpath_codepoint == 0 || !(box->flags & UI_BoxFlag_DrawTextFastpathCodepoint)))
{
String8 display_string = ui_box_display_string(box);
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->scheme->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[text_color_code], box->font_size, 0, 0}};
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
}
@@ -2318,15 +2307,15 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
U64 fpcp_pos = str8_find_needle(display_string, 0, fpcp, StringMatchFlag_CaseInsensitive);
if(fpcp_pos < display_string.size)
{
D_FancyStringNode pst_fancy_string_n = {0, {box->font, str8_skip(display_string, fpcp_pos+fpcp.size), box->scheme->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
D_FancyStringNode cdp_fancy_string_n = {&pst_fancy_string_n, {box->font, str8_substr(display_string, r1u64(fpcp_pos, fpcp_pos+fpcp.size)), box->scheme->colors[UI_ColorCode_Text], box->font_size, 4.f, 0}};
D_FancyStringNode pre_fancy_string_n = {&cdp_fancy_string_n, {box->font, str8_prefix(display_string, fpcp_pos), box->scheme->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
D_FancyStringNode pst_fancy_string_n = {0, {box->font, str8_skip(display_string, fpcp_pos+fpcp.size), box->palette->colors[text_color_code], box->font_size, 0, 0}};
D_FancyStringNode cdp_fancy_string_n = {&pst_fancy_string_n, {box->font, str8_substr(display_string, r1u64(fpcp_pos, fpcp_pos+fpcp.size)), box->palette->colors[text_color_code], box->font_size, 4.f, 0}};
D_FancyStringNode pre_fancy_string_n = {&cdp_fancy_string_n, {box->font, str8_prefix(display_string, fpcp_pos), box->palette->colors[text_color_code], box->font_size, 0, 0}};
D_FancyStringList fancy_strings = {&pre_fancy_string_n, &pst_fancy_string_n, 3};
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
}
else
{
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->scheme->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
}
+54 -51
View File
@@ -212,8 +212,8 @@ typedef enum UI_ColorCode
}
UI_ColorCode;
typedef struct UI_ColorScheme UI_ColorScheme;
struct UI_ColorScheme
typedef struct UI_Palette UI_Palette;
struct UI_Palette
{
union
{
@@ -289,44 +289,45 @@ typedef U64 UI_BoxFlags;
# define UI_BoxFlag_DefaultFocusNavY (UI_BoxFlags)(1ull<<14)
# define UI_BoxFlag_DefaultFocusEdit (UI_BoxFlags)(1ull<<15)
# define UI_BoxFlag_FocusNavSkip (UI_BoxFlags)(1ull<<16)
# define UI_BoxFlag_Disabled (UI_BoxFlags)(1ull<<17)
# define UI_BoxFlag_DisableTruncatedHover (UI_BoxFlags)(1ull<<17)
# define UI_BoxFlag_Disabled (UI_BoxFlags)(1ull<<18)
//- rjf: layout
# define UI_BoxFlag_FloatingX (UI_BoxFlags)(1ull<<18)
# define UI_BoxFlag_FloatingY (UI_BoxFlags)(1ull<<19)
# define UI_BoxFlag_FixedWidth (UI_BoxFlags)(1ull<<20)
# define UI_BoxFlag_FixedHeight (UI_BoxFlags)(1ull<<21)
# define UI_BoxFlag_AllowOverflowX (UI_BoxFlags)(1ull<<22)
# define UI_BoxFlag_AllowOverflowY (UI_BoxFlags)(1ull<<23)
# define UI_BoxFlag_SkipViewOffX (UI_BoxFlags)(1ull<<24)
# define UI_BoxFlag_SkipViewOffY (UI_BoxFlags)(1ull<<25)
# define UI_BoxFlag_FloatingX (UI_BoxFlags)(1ull<<19)
# define UI_BoxFlag_FloatingY (UI_BoxFlags)(1ull<<20)
# define UI_BoxFlag_FixedWidth (UI_BoxFlags)(1ull<<21)
# define UI_BoxFlag_FixedHeight (UI_BoxFlags)(1ull<<22)
# define UI_BoxFlag_AllowOverflowX (UI_BoxFlags)(1ull<<23)
# define UI_BoxFlag_AllowOverflowY (UI_BoxFlags)(1ull<<24)
# define UI_BoxFlag_SkipViewOffX (UI_BoxFlags)(1ull<<25)
# define UI_BoxFlag_SkipViewOffY (UI_BoxFlags)(1ull<<26)
//- rjf: appearance / animation
# define UI_BoxFlag_DrawDropShadow (UI_BoxFlags)(1ull<<26)
# define UI_BoxFlag_DrawBackgroundBlur (UI_BoxFlags)(1ull<<27)
# define UI_BoxFlag_DrawBackground (UI_BoxFlags)(1ull<<28)
# define UI_BoxFlag_DrawBorder (UI_BoxFlags)(1ull<<29)
# define UI_BoxFlag_DrawSideTop (UI_BoxFlags)(1ull<<30)
# define UI_BoxFlag_DrawSideBottom (UI_BoxFlags)(1ull<<31)
# define UI_BoxFlag_DrawSideLeft (UI_BoxFlags)(1ull<<32)
# define UI_BoxFlag_DrawSideRight (UI_BoxFlags)(1ull<<33)
# define UI_BoxFlag_DrawText (UI_BoxFlags)(1ull<<34)
# define UI_BoxFlag_DrawTextFastpathCodepoint (UI_BoxFlags)(1ull<<35)
# define UI_BoxFlag_DrawTextWeak (UI_BoxFlags)(1ull<<36)
# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<37)
# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<38)
# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<39)
# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<40)
# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<41)
# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<42)
# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<43)
# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<44)
# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<45)
# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<46)
# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<47)
# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<48)
# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<49)
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<50)
# define UI_BoxFlag_DrawDropShadow (UI_BoxFlags)(1ull<<27)
# define UI_BoxFlag_DrawBackgroundBlur (UI_BoxFlags)(1ull<<28)
# define UI_BoxFlag_DrawBackground (UI_BoxFlags)(1ull<<29)
# define UI_BoxFlag_DrawBorder (UI_BoxFlags)(1ull<<30)
# define UI_BoxFlag_DrawSideTop (UI_BoxFlags)(1ull<<31)
# define UI_BoxFlag_DrawSideBottom (UI_BoxFlags)(1ull<<32)
# define UI_BoxFlag_DrawSideLeft (UI_BoxFlags)(1ull<<33)
# define UI_BoxFlag_DrawSideRight (UI_BoxFlags)(1ull<<34)
# define UI_BoxFlag_DrawText (UI_BoxFlags)(1ull<<35)
# define UI_BoxFlag_DrawTextFastpathCodepoint (UI_BoxFlags)(1ull<<36)
# define UI_BoxFlag_DrawTextWeak (UI_BoxFlags)(1ull<<37)
# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<38)
# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<39)
# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<40)
# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<41)
# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<42)
# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<43)
# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<44)
# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<45)
# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<46)
# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<47)
# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<48)
# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<49)
# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<50)
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<51)
//- rjf: bundles
# define UI_BoxFlag_Clickable (UI_BoxFlag_MouseClickable|UI_BoxFlag_KeyboardClickable)
@@ -368,7 +369,7 @@ struct UI_Box
D_Bucket *draw_bucket;
UI_BoxCustomDrawFunctionType *custom_draw;
void *custom_draw_user_data;
UI_ColorScheme *scheme;
UI_Palette *palette;
F_Tag font;
F32 font_size;
F32 tab_size;
@@ -642,7 +643,7 @@ internal UI_Size ui_size(UI_SizeKind kind, F32 value, F32 strictness);
////////////////////////////////
//~ rjf: Color Scheme Type Functions
read_only global UI_ColorScheme ui_g_nil_color_scheme = {0};
read_only global UI_Palette ui_g_nil_palette = {0};
////////////////////////////////
//~ rjf: Scroll Point Type Functions
@@ -760,13 +761,9 @@ internal B32 ui_is_key_auto_focus_hot(UI_Key key);
internal void ui_set_auto_focus_active_key(UI_Key key);
internal void ui_set_auto_focus_hot_key(UI_Key key);
//- rjf: color scheme forming
internal UI_ColorScheme * ui_push_color_scheme_(UI_ColorScheme *params);
internal UI_ColorScheme * ui_fork_color_scheme_(UI_ColorScheme *scheme, UI_ColorScheme *overrides);
internal UI_ColorScheme * ui_fork_top_color_scheme_(UI_ColorScheme *params);
#define ui_push_color_scheme(...) ui_push_color_scheme_(&(UI_ColorScheme){__VA_ARGS__})
#define ui_fork_color_scheme(scheme, ...) ui_fork_color_scheme_((scheme), &(UI_ColorScheme){__VA_ARGS__})
#define ui_fork_top_color_scheme(...) ui_fork_top_color_scheme_(&(UI_ColorScheme){__VA_ARGS__})
//- rjf: palette forming
internal UI_Palette * ui_build_palette_(UI_Palette *base, UI_Palette *overrides);
#define ui_build_palette(base, ...) ui_build_palette_((base), &(UI_Palette){.text = v4f32(1, 1, 1, 1), __VA_ARGS__})
//- rjf: box node construction
internal UI_Box * ui_build_box_from_key(UI_BoxFlags flags, UI_Key key);
@@ -809,11 +806,12 @@ internal UI_FocusKind ui_top_focus_hot(void);
internal UI_FocusKind ui_top_focus_active(void);
internal U32 ui_top_fastpath_codepoint(void);
internal F32 ui_top_transparency(void);
internal UI_ColorScheme* ui_top_scheme(void);
internal UI_Palette* ui_top_palette(void);
internal F32 ui_top_squish(void);
internal OS_Cursor ui_top_hover_cursor(void);
internal F_Tag ui_top_font(void);
internal F32 ui_top_font_size(void);
internal F_RunFlags ui_top_run_flags(void);
internal F32 ui_top_tab_size(void);
internal F32 ui_top_corner_radius_00(void);
internal F32 ui_top_corner_radius_01(void);
@@ -835,11 +833,12 @@ internal UI_FocusKind ui_bottom_focus_hot(void);
internal UI_FocusKind ui_bottom_focus_active(void);
internal U32 ui_bottom_fastpath_codepoint(void);
internal F32 ui_bottom_transparency(void);
internal UI_ColorScheme* ui_bottom_scheme(void);
internal UI_Palette* ui_bottom_palette(void);
internal F32 ui_bottom_squish(void);
internal OS_Cursor ui_bottom_hover_cursor(void);
internal F_Tag ui_bottom_font(void);
internal F32 ui_bottom_font_size(void);
internal F_RunFlags ui_bottom_run_flags(void);
internal F32 ui_bottom_tab_size(void);
internal F32 ui_bottom_corner_radius_00(void);
internal F32 ui_bottom_corner_radius_01(void);
@@ -861,11 +860,12 @@ internal UI_FocusKind ui_push_focus_hot(UI_FocusKind v);
internal UI_FocusKind ui_push_focus_active(UI_FocusKind v);
internal U32 ui_push_fastpath_codepoint(U32 v);
internal F32 ui_push_transparency(F32 v);
internal UI_ColorScheme* ui_push_scheme(UI_ColorScheme* v);
internal UI_Palette* ui_push_palette(UI_Palette* v);
internal F32 ui_push_squish(F32 v);
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v);
internal F_Tag ui_push_font(F_Tag v);
internal F32 ui_push_font_size(F32 v);
internal F_RunFlags ui_push_run_flags(F_RunFlags v);
internal F32 ui_push_tab_size(F32 v);
internal F32 ui_push_corner_radius_00(F32 v);
internal F32 ui_push_corner_radius_01(F32 v);
@@ -887,11 +887,12 @@ internal UI_FocusKind ui_pop_focus_hot(void);
internal UI_FocusKind ui_pop_focus_active(void);
internal U32 ui_pop_fastpath_codepoint(void);
internal F32 ui_pop_transparency(void);
internal UI_ColorScheme* ui_pop_scheme(void);
internal UI_Palette* ui_pop_palette(void);
internal F32 ui_pop_squish(void);
internal OS_Cursor ui_pop_hover_cursor(void);
internal F_Tag ui_pop_font(void);
internal F32 ui_pop_font_size(void);
internal F_RunFlags ui_pop_run_flags(void);
internal F32 ui_pop_tab_size(void);
internal F32 ui_pop_corner_radius_00(void);
internal F32 ui_pop_corner_radius_01(void);
@@ -913,11 +914,12 @@ internal UI_FocusKind ui_set_next_focus_hot(UI_FocusKind v);
internal UI_FocusKind ui_set_next_focus_active(UI_FocusKind v);
internal U32 ui_set_next_fastpath_codepoint(U32 v);
internal F32 ui_set_next_transparency(F32 v);
internal UI_ColorScheme* ui_set_next_scheme(UI_ColorScheme* v);
internal UI_Palette* ui_set_next_palette(UI_Palette* v);
internal F32 ui_set_next_squish(F32 v);
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v);
internal F_Tag ui_set_next_font(F_Tag v);
internal F32 ui_set_next_font_size(F32 v);
internal F_RunFlags ui_set_next_run_flags(F_RunFlags v);
internal F32 ui_set_next_tab_size(F32 v);
internal F32 ui_set_next_corner_radius_00(F32 v);
internal F32 ui_set_next_corner_radius_01(F32 v);
@@ -953,11 +955,12 @@ internal void ui_pop_corner_radius(void);
#define UI_FocusActive(v) DeferLoop(ui_push_focus_active(v), ui_pop_focus_active())
#define UI_FastpathCodepoint(v) DeferLoop(ui_push_fastpath_codepoint(v), ui_pop_fastpath_codepoint())
#define UI_Transparency(v) DeferLoop(ui_push_transparency(v), ui_pop_transparency())
#define UI_Scheme(v) DeferLoop(ui_push_scheme(v), ui_pop_scheme())
#define UI_Palette(v) DeferLoop(ui_push_palette(v), ui_pop_palette())
#define UI_Squish(v) DeferLoop(ui_push_squish(v), ui_pop_squish())
#define UI_HoverCursor(v) DeferLoop(ui_push_hover_cursor(v), ui_pop_hover_cursor())
#define UI_Font(v) DeferLoop(ui_push_font(v), ui_pop_font())
#define UI_FontSize(v) DeferLoop(ui_push_font_size(v), ui_pop_font_size())
#define UI_RunFlags(v) DeferLoop(ui_push_run_flags(v), ui_pop_run_flags())
#define UI_TabSize(v) DeferLoop(ui_push_tab_size(v), ui_pop_tab_size())
#define UI_CornerRadius00(v) DeferLoop(ui_push_corner_radius_00(v), ui_pop_corner_radius_00())
#define UI_CornerRadius01(v) DeferLoop(ui_push_corner_radius_01(v), ui_pop_corner_radius_01())