Improvements

This commit is contained in:
2024-12-01 17:55:08 +01:00
parent 80de060002
commit 1077800334
6 changed files with 73 additions and 20 deletions

View File

@@ -285,6 +285,17 @@ ui_int_field :: (label: string, value: *int, identifier: s64 = 0, loc := #caller
ui_set_next_size_x(.CHILDREN_SUM, 1);
}
ui_float_field :: (label: string, value: *float, identifier: s64 = 0, loc := #caller_location) {
ui_container_layout(identifier=identifier, loc=loc);
ui_set_next_size_x(.CHILDREN_SUM);
ui_push_parent(ui_state.last_box, .LEFT, .HORIZONTAL);
{
ui_label(label);
ui_float_field(value, identifier);
}
ui_pop_parent();
}
ui_float_field :: (value: *float, identifier: s64 = 0, loc := #caller_location) {
ui_set_next_background_color(.{0.0,1.0,1.0,0.0});
ui_set_next_border_color(.{0.3,0.3,0.3,1.0});
@@ -350,6 +361,7 @@ ui_float_field :: (value: *float, identifier: s64 = 0, loc := #caller_location)
case "7";#through;
case "8";#through;
case "9";#through;
case "-";#through;
case "."; {
if !(text_str == "." && (array_contains(text_widget._number_text, #char ".") || text_widget._number_text.count == 0)) {
text_widget._number_text.data[text_widget._number_text.count] = text_str[0];