fix input flags

This commit is contained in:
silverweed 2024-11-12 14:40:53 +01:00
parent 602ef799e3
commit 80657ebbd9

View file

@ -303,7 +303,6 @@ void update_and_render(Arena *arena, App_State &app, f32 delta_time_ms)
ImGui::TableNextColumn();
const ImGuiColorEditFlags edit_flags = ImGuiColorEditFlags_NoInputs|ImGuiColorEditFlags_NoLabel;
const ImGuiInputTextFlags input_flags = 0;//ImGuiInputTextFlags_EnterReturnsTrue; // FIXME
// Unique sections: just display a button that jumps to the start of it and show their size
for (u32 i = 0; i < Sec_COUNT; ++i) {
@ -339,12 +338,18 @@ void update_and_render(Arena *arena, App_State &app, f32 delta_time_ms)
const i64 step_fast_i64 = app.rndata.n_pages / 100;
i64 page_to_go_to = app.viewer.latest_page_gone_to;
ImGui::PushItemWidth(100.f);
if (ImGui::InputScalar("##page_viewed", ImGuiDataType_S64, &page_to_go_to, &step_i64, &step_fast_i64, "%u", input_flags))
if (ImGui::InputScalar("##page_viewed", ImGuiDataType_S64, &page_to_go_to, &step_i64, &step_fast_i64, "%u") &&
ImGui::IsItemDeactivatedAfterEdit())
{
app.viewer.latest_page = viewer_jump_to_page(app, page_to_go_to);
}
ImGui::PopItemWidth();
}
ImGui::SameLine();
String8 this_page_width = app.viewer.latest_page ? push_str8f(scratch.arena, " (this page: %s)", to_pretty_size(scratch.arena, app.viewer.latest_page->range.len).c()) : str8("");
String8 this_page_width = app.viewer.latest_page
? push_str8f(scratch.arena, " (this page: %s)",
to_pretty_size(scratch.arena, app.viewer.latest_page->range.len).c())
: str8("");
ImGui::Text("%s%s", to_pretty_size(scratch.arena, app.rndata.tot_page_comp_size).c(), this_page_width.c());
ImGui::ColorEdit3("_Checksum", app.viewer.col_checksum, edit_flags);
@ -360,8 +365,11 @@ void update_and_render(Arena *arena, App_State &app, f32 delta_time_ms)
{
i64 page_list_to_go_to = app.viewer.latest_page_list_gone_to;
ImGui::PushItemWidth(80.f);
if (ImGui::InputScalar("##page_list_viewed", ImGuiDataType_S64, &page_list_to_go_to, &step_i64, nullptr, "%u", input_flags))
if (ImGui::InputScalar("##page_list_viewed", ImGuiDataType_S64, &page_list_to_go_to, &step_i64, nullptr, "%u")
&& ImGui::IsItemDeactivatedAfterEdit())
{
viewer_jump_to_page_list(app, page_list_to_go_to);
}
ImGui::PopItemWidth();
}
ImGui::SameLine();
@ -388,7 +396,9 @@ void update_and_render(Arena *arena, App_State &app, f32 delta_time_ms)
const i64 step_fast_i64 = app.rndata.n_clusters / 100;
i64 cluster_to_highlight = app.viewer.highlighted_cluster;
ImGui::PushItemWidth(100.f);
if (ImGui::InputScalar("##highlighted_cluster", ImGuiDataType_S64, &cluster_to_highlight, &step_i64, &step_fast_i64, "%u", input_flags)) {
if (ImGui::InputScalar("##highlighted_cluster", ImGuiDataType_S64, &cluster_to_highlight, &step_i64, &step_fast_i64, "%u") &&
ImGui::IsItemDeactivatedAfterEdit())
{
viewer_jump_to_cluster(app, cluster_to_highlight);
}
ImGui::PopItemWidth();