Skip to content
Snippets Groups Projects
Commit dc82cf88 authored by Martin Štourač's avatar Martin Štourač
Browse files

improve ui text input

parent 6881b694
No related branches found
No related tags found
No related merge requests found
......@@ -920,12 +920,10 @@ void save_module_ui(const osi::Window &window, edit::UIData &data)
}
ImGui::InputText("Module Name##ModuleNameInput", data.name_buffer, sizeof(data.name_buffer),
ImGuiInputTextFlags_AutoSelectAll
| ImGuiInputTextFlags_AlwaysOverwrite);
ImGuiInputTextFlags_AutoSelectAll);
ImGui::InputInt("Module ID##SaveModuleIDInput", &data.module_id,
ImGuiInputTextFlags_AutoSelectAll
| ImGuiInputTextFlags_AlwaysOverwrite
| ImGuiInputTextFlags_CharsDecimal);
if (data.save_module_error && data.current_second - data.error_start_second < 2)
......@@ -972,12 +970,10 @@ void export_module_file_ui(const osi::Window &window, edit::UIData &data)
// InputText takes a pointer to a buffer, a maximum buffer size, and optional flags
ImGui::InputText("File Name##ModuleFileNameInput", data.name_buffer, sizeof(data.name_buffer),
ImGuiInputTextFlags_AutoSelectAll
| ImGuiInputTextFlags_AlwaysOverwrite);
ImGuiInputTextFlags_AutoSelectAll);
ImGui::InputInt("Module ID##ExportModuleIDInput", &data.module_id,
ImGuiInputTextFlags_AutoSelectAll
| ImGuiInputTextFlags_AlwaysOverwrite
| ImGuiInputTextFlags_CharsDecimal);
if (data.export_file_error && data.current_second - data.error_start_second < 2)
......@@ -1008,9 +1004,13 @@ void export_rofiworld_file_ui(const osi::Window &window, edit::UIData &data)
ImGui::Text("Enter Text:");
// InputText takes a pointer to a buffer, a maximum buffer size, and optional flags
ImGui::InputText("File Name##RofiWorldExportFileNameInput", data.name_buffer, sizeof(data.name_buffer),
if (ImGui::InputText("File Name##RofiWorldExportFileNameInput", data.name_buffer, sizeof(data.name_buffer),
ImGuiInputTextFlags_AutoSelectAll
| ImGuiInputTextFlags_AlwaysOverwrite);
| ImGuiInputTextFlags_EnterReturnsTrue))
{
data.export_file_prompt = true;
data.export_file_visible = false;
}
if (data.export_file_error && data.current_second - data.error_start_second < 2)
ImGui::Text(data.error_msg.c_str());
......@@ -1049,12 +1049,17 @@ void import_rofiworld_file_ui(const osi::Window &window, edit::UIData &data)
return;
}
ImGui::Text("Enter Text:");
ImGui::Text("Enter name of file");
ImGui::Text("from /data/rofi/rofiworlds/:");
// InputText takes a pointer to a buffer, a maximum buffer size, and optional flags
ImGui::InputText("File Name##RofiWorldImportFileNameInput", data.name_buffer, sizeof(data.name_buffer),
if (ImGui::InputText(".json##RofiWorldImportFileNameInput", data.name_buffer, sizeof(data.name_buffer),
ImGuiInputTextFlags_AutoSelectAll
| ImGuiInputTextFlags_AlwaysOverwrite);
| ImGuiInputTextFlags_EnterReturnsTrue))
{
data.import_file_prompt = true;
data.import_file_visible = false;
}
if (data.import_file_error && data.current_second - data.error_start_second < 2)
ImGui::Text(data.error_msg.c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment