From 522395d37e0133166ee13be1e6546d0f5be79587 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 17 May 2025 13:14:27 +0200 Subject: [PATCH] Add a send message button. --- profiler/src/profiler/TracyLlm.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index d043aaa9..913417d9 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -451,8 +451,14 @@ void TracyLlm::Draw() ImGui::SetKeyboardFocusHere( 0 ); m_focusInput = false; } - ImGui::PushItemWidth( -1 ); - if( ImGui::InputTextWithHint( "##ollama_input", "Write your question here...", m_input, InputBufferSize, ImGuiInputTextFlags_EnterReturnsTrue ) ) + const char* buttonText = ICON_FA_PAPER_PLANE; + auto buttonSize = ImGui::CalcTextSize( buttonText ); + buttonSize.x += ImGui::GetStyle().FramePadding.x * 2.0f + ImGui::GetStyle().ItemSpacing.x; + ImGui::PushItemWidth( ImGui::GetContentRegionAvail().x - buttonSize.x ); + bool send = ImGui::InputTextWithHint( "##ollama_input", "Write your question here...", m_input, InputBufferSize, ImGuiInputTextFlags_EnterReturnsTrue ); + ImGui::SameLine(); + send |= ImGui::Button( buttonText ); + if( send ) { auto ptr = m_input; while( *ptr )