summaryrefslogtreecommitdiff
path: root/src/ui/helpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/helpers.cpp')
-rw-r--r--src/ui/helpers.cpp42
1 files changed, 3 insertions, 39 deletions
diff --git a/src/ui/helpers.cpp b/src/ui/helpers.cpp
index 0cce207..7bde384 100644
--- a/src/ui/helpers.cpp
+++ b/src/ui/helpers.cpp
@@ -3,43 +3,6 @@
#include "locales.hpp"
#include "strops.hpp"
-static float toast_timer = 0.0f;
-static const char* toast_msg = nullptr;
-void ui_helper_show_toast(const char* msg)
-{
- toast_msg = msg;
- toast_timer = 3.0f;
-}
-
-void ui_helper_draw_toasts()
-{
- if (toast_timer > 0.0f && toast_msg)
- {
- toast_timer -= ImGui::GetIO().DeltaTime;
-
- const float pad = 10.0f;
- const ImVec2 window_pos = ImVec2(
- ImGui::GetIO().DisplaySize.x - pad,
- ImGui::GetIO().DisplaySize.y - pad
- );
- const ImVec2 window_pos_pivot = ImVec2(1.0f, 1.0f);
-
- ImGui::SetNextWindowPos(window_pos, ImGuiCond_Always, window_pos_pivot);
- ImGui::SetNextWindowBgAlpha(0.85f); // semi-transparent
-
- ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration |
- ImGuiWindowFlags_AlwaysAutoResize |
- ImGuiWindowFlags_NoFocusOnAppearing |
- ImGuiWindowFlags_NoNav;
-
- if (ImGui::Begin("##Toast", nullptr, flags))
- {
- ImGui::TextUnformatted(toast_msg);
- }
- ImGui::End();
- }
-}
-
void ui_helper_draw_required_tag()
{
ImDrawList* draw_list = ImGui::GetWindowDrawList();
@@ -65,7 +28,7 @@ void ui_helper_draw_required_tag()
ImGui::PopStyleColor();
}
-int ui_helper_TextInputWithAutocomplete(const char* label, const char* hint, char* buffer, size_t buf_size,
+int TextInputWithAutocomplete(const char* label, const char* hint, char* buffer, size_t buf_size,
char* suggestions[], int suggestion_count)
{
int result = -1;
@@ -110,4 +73,5 @@ int ui_helper_TextInputWithAutocomplete(const char* label, const char* hint, cha
}
}
return result;
-} \ No newline at end of file
+}
+