more reduction of direct mutuable state referencing

This commit is contained in:
2024-12-30 13:26:14 -05:00
parent 7ed0010761
commit 841260849e
6 changed files with 70 additions and 62 deletions

View File

@ -34,7 +34,7 @@ theme_button :: proc() -> UI_Theme
border_color = app_color.border_default,
corner_radii = {},
blur_size = 0,
font = get_state().default_font,
font = get_default_font(),
text_color = app_color.text_default,
cursor = {},
}
@ -83,7 +83,7 @@ theme_drop_down_btn :: proc() -> UI_Theme
border_color = app_color.border_default,
corner_radii = {},
blur_size = 0,
font = get_state().default_font,
font = get_default_font(),
text_color = app_color.text_default,
cursor = {},
}
@ -140,7 +140,7 @@ theme_table_row :: proc( is_even : bool ) -> UI_Theme
border_color = Color_Transparent,
corner_radii = {},
blur_size = 0,
font = get_state().default_font,
font = get_default_font(),
text_color = app_color_theme().text_default,
cursor = {},
}
@ -188,7 +188,7 @@ theme_window_bar :: proc() -> UI_Theme
border_color = Color_Transparent,
corner_radii = {0, 0, 0, 0 },
blur_size = 0,
font = get_state().default_font,
font = get_default_font(),
text_color = app_color.text_default,
cursor = {},
}
@ -240,7 +240,7 @@ theme_window_bar_title :: proc() -> UI_Theme
border_color = Color_Transparent,
corner_radii = {0, 0, 0, 0},
blur_size = 0,
font = get_state().default_font,
font = get_default_font(),
text_color = app_color.text_default,
cursor = {},
}
@ -288,7 +288,7 @@ theme_window_bar_btn :: proc() -> UI_Theme
border_color = app_color.border_default,
corner_radii = {},
blur_size = 0,
font = get_state().default_font,
font = get_default_font(),
text_color = app_color.text_default,
cursor = {},
}
@ -337,7 +337,7 @@ theme_window_panel :: proc() -> UI_Theme
border_color = app_color.window_panel_border,
corner_radii = { 0, 0, 0, 0 },
blur_size = 0,
font = get_state().default_font,
font = get_default_font(),
text_color = app_color.text_default,
cursor = {},
}
@ -385,7 +385,7 @@ theme_transparent :: proc() -> UI_Theme
border_color = Color_Transparent,
corner_radii = {},
blur_size = 0,
font = get_state().default_font,
font = get_default_font(),
text_color = app_color.text_default,
cursor = {},
}
@ -433,7 +433,7 @@ theme_text :: proc() -> UI_Theme
border_color = Color_Transparent,
corner_radii = {},
blur_size = 0,
font = get_state().default_font,
font = get_default_font(),
text_color = app_color.text_default,
cursor = {},
}

View File

@ -581,6 +581,10 @@ UI_TextInputBox :: struct {
using policy : UI_TextInput_Policy,
}
ui_text_input_box_reload :: #force_inline proc ( text_box : ^UI_TextInputBox, allocator : Allocator ) {
text_box.input_str.backing = allocator
}
ui_text_input_box :: proc( text_input_box : ^UI_TextInputBox, label : string,
flags : UI_BoxFlags = {.Mouse_Clickable, .Focusable, .Click_To_Focus},
allocator := context.allocator,