diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-18 08:41:54 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-18 08:41:54 +0200 |
| commit | c1d950f2765cde614c8411b4effb3850146ba598 (patch) | |
| tree | 408372166c170bfabc3e23a02d8aaa48b662696c /src/ui/ui_settings.cpp | |
| parent | a8799cfee2de8ac53cc07c571c56ae5d9c98cbbd (diff) | |
ui loading animation for model request
Diffstat (limited to 'src/ui/ui_settings.cpp')
| -rw-r--r-- | src/ui/ui_settings.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/ui/ui_settings.cpp b/src/ui/ui_settings.cpp index cf27b49..a4b5748 100644 --- a/src/ui/ui_settings.cpp +++ b/src/ui/ui_settings.cpp @@ -16,7 +16,6 @@ #include "ui.hpp" -#include "imgui.h" #include "strops.hpp" #include "memops.hpp" #include "locales.hpp" @@ -396,15 +395,24 @@ static void draw_services() } else { ImGui::BeginDisabled(); - if (ImGui::BeginCombo(locale::get("settings.services.ai_service.model"), new_service.model_name)) + ImGui::BeginCombo(locale::get("settings.services.ai_service.model"), NULL, 1 << 20); { - ImGui::EndCombo(); - } - if (model_request->status != importer::status::IMPORT_DONE) { - ImGui::SameLine(); + if (ImGui::BeginComboPreview()) + { + if (model_request->status != importer::status::IMPORT_DONE) { + float radius = 10.0f; + const ImVec4 col = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); + const ImVec4 bg = ImGui::GetStyleColorVec4(ImGuiCol_Button); + ImGui::LoadingIndicatorCircle("##loadingAnim", radius, bg, col, 6, 4.0f); + + ImGui::SameLine(); + } + ImGui::TextUnformatted(new_service.model_name); + + ImGui::EndComboPreview(); + } - // TODO replace with LoadingIndicatorCircle - ImGui::Text("%c", "|/-\\"[(int)(ImGui::GetTime() / 0.05f) & 3]); + //ImGui::EndCombo(); } ImGui::EndDisabled(); } |
