summaryrefslogtreecommitdiff
path: root/src/ui/imgui_extensions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/imgui_extensions.cpp')
-rw-r--r--src/ui/imgui_extensions.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/ui/imgui_extensions.cpp b/src/ui/imgui_extensions.cpp
index 5fdc3a7..1875c22 100644
--- a/src/ui/imgui_extensions.cpp
+++ b/src/ui/imgui_extensions.cpp
@@ -9,19 +9,16 @@
namespace ImGui
{
- void FormInputTextWithErrorHint(const char* hint, void* data, char* buffer, size_t buf_size, bool has_error)
+ void FormInputTextWithErrorHint(const char* hint, char* buffer, size_t buf_size, bool has_error)
{
float widthAvailable = ImGui::GetContentRegionAvail().x;
ImGui::SetNextItemWidth(widthAvailable*0.5f);
- char id[MAX_LEN_LONG_DESC];
- snprintf(id, sizeof(id), "%s##%p", hint, data);
-
if (has_error) {
ImGui::PushStyleColor(ImGuiCol_Border, COLOR_ERROR_OUTLINE);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.5f);
}
- ImGui::InputTextWithHint(id, hint, buffer, buf_size);
+ ImGui::InputTextWithHint(hint, hint, buffer, buf_size);
if (has_error) {
ImGui::PopStyleVar();
ImGui::PopStyleColor();
@@ -32,10 +29,9 @@ namespace ImGui
}
}
- void FormCountryCombo(void* data, char* buffer, size_t buf_size)
+ void FormCountryCombo(char* buffer, size_t buf_size)
{
const char* selected_country = 0;
- char id[MAX_LEN_LONG_DESC];
float widthAvailable = ImGui::GetContentRegionAvail().x;
ImGui::SetNextItemWidth(widthAvailable*0.5f);
@@ -58,14 +54,12 @@ namespace ImGui
bool has_a_selection = selected_country != 0;
int selected_country_index = -1;
- snprintf(id, sizeof(id), "%s##%p", localize("contact.form.country"), data);
-
if (!has_a_selection) {
ImGui::PushStyleColor(ImGuiCol_Border, COLOR_ERROR_OUTLINE);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.5f);
}
- if (ImGui::BeginCombo(id, selected_country))
+ if (ImGui::BeginCombo(localize("contact.form.country"), selected_country))
{
for (int n = 0; n < country_count; n++)
{