From cb60fe1d945f7254f5da810dcf4926ad769bc7ac Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Thu, 30 Jul 2026 08:21:48 +0200 Subject: [PATCH] Remove obsolete imgui functions --- client/render/ui_widgets.cpp | 12 ++++++------ client/scenes/app_launcher.cpp | 4 ++-- client/scenes/lobby_keyboard.cpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client/render/ui_widgets.cpp b/client/render/ui_widgets.cpp index 13043dae..41b93462 100644 --- a/client/render/ui_widgets.cpp +++ b/client/render/ui_widgets.cpp @@ -127,7 +127,7 @@ bool begin_card_impl(const char * id, ImVec2 padding) card.w *= background_alpha(); // card fill follows the panel opacity window->DrawList->AddRectFilled(cf.origin, bb_max, t.col(card), t.card_rounding); if (t.border_size > 0) - window->DrawList->AddRect(cf.origin, bb_max, t.col(t.border), t.card_rounding, 0, t.border_size); + window->DrawList->AddRect(cf.origin, bb_max, t.col(t.border), t.card_rounding, t.border_size); } ImGui::PushID(id); @@ -450,7 +450,7 @@ bool cancel_progress_button(const char * id, float fraction, const ImVec2 & size // faint full ring as the track draw->PathArcTo(center, radius, 0, 2 * IM_PI, 48); - draw->PathStroke(t.col(t.control), ImDrawFlags_None, thickness); + draw->PathStroke(t.col(t.control), thickness); const ImU32 accent = t.col(t.accent); if (fraction >= 0) @@ -458,14 +458,14 @@ bool cancel_progress_button(const char * id, float fraction, const ImVec2 & size // determinate arc, clockwise from the top const float a0 = -IM_PI * 0.5f; draw->PathArcTo(center, radius, a0, a0 + ImClamp(fraction, 0.f, 1.f) * 2 * IM_PI, 48); - draw->PathStroke(accent, ImDrawFlags_None, thickness); + draw->PathStroke(accent, thickness); } else { // indeterminate: a rotating quarter arc const float a0 = float(g.Time) * 3.5f; draw->PathArcTo(center, radius, a0, a0 + IM_PI * 0.5f, 24); - draw->PathStroke(accent, ImDrawFlags_None, thickness); + draw->PathStroke(accent, thickness); } // stop glyph in the centre, brightening on hover to read as a cancel target @@ -787,7 +787,7 @@ bool combo_impl(const char * id, const std::string & title, const char * preview ImDrawList * draw = window->DrawList; draw->AddRectFilled(bb.Min, bb.Max, t.col(box), t.rounding); if (t.border_size > 0) - draw->AddRect(bb.Min, bb.Max, t.col(t.border), t.rounding, 0, t.border_size); + draw->AddRect(bb.Min, bb.Max, t.col(t.border), t.rounding, t.border_size); const int sel = selected ? ImClamp(*selected, 0, int(items.size()) - 1) : -1; @@ -1429,7 +1429,7 @@ void sidebar_footer() ::ScrollWhenDragging(); // drag to scroll the nav list, like the rest of the GUI ImGui::EndChild(); // TabsScroll // pin the footer to the bottom of the sidebar - ImGui::SetCursorPosY(ImGui::GetContentRegionMax().y - sidebar_footer_height); + ImGui::SetCursorPosY(ImGui::GetContentRegionAvail().y + ImGui::GetCursorScreenPos().y - ImGui::GetWindowPos().y - sidebar_footer_height); } void end_sidebar() diff --git a/client/scenes/app_launcher.cpp b/client/scenes/app_launcher.cpp index fd9863aa..5e62a92f 100644 --- a/client/scenes/app_launcher.cpp +++ b/client/scenes/app_launcher.cpp @@ -83,7 +83,7 @@ bool app_tile(const std::string & id, const std::string & name, ImTextureID text : t.control), t.card_rounding); if (hovered) - dl->AddRect(bb.Min, bb.Max, t.col(t.accent), t.card_rounding, 0, t.border_size * 2); + dl->AddRect(bb.Min, bb.Max, t.col(t.accent), t.card_rounding, t.border_size * 2); const ImVec2 image_min{(bb.Min.x + bb.Max.x - image_size) / 2, bb.Min.y + pad}; dl->AddImage(texture, image_min, image_min + ImVec2{image_size, image_size}); @@ -175,7 +175,7 @@ app_launcher::clicked app_launcher::draw_gui(imgui_context & imgui_ctx, const st const float disconnect_w = ui::button_width(cancel); // title row stays fixed: view/size toggles then disconnect, right-aligned, disconnect stays enabled while an app starts - const float right = ImGui::GetContentRegionMax().x; + const float right = ImGui::GetContentRegionAvail().x + ImGui::GetCursorScreenPos().x - ImGui::GetWindowPos().x; ImGui::SetCursorPos({right - disconnect_w, header_top}); if (ui::button(cancel, ui::button_style::danger)) res = clicked::Cancel; diff --git a/client/scenes/lobby_keyboard.cpp b/client/scenes/lobby_keyboard.cpp index a61430d1..59a6bc2b 100644 --- a/client/scenes/lobby_keyboard.cpp +++ b/client/scenes/lobby_keyboard.cpp @@ -393,7 +393,7 @@ virtual_keyboard::key_status virtual_keyboard::draw_single_key(const key & k, in const ImU32 col = ImGui::GetColorU32(active ? ImGuiCol_ButtonActive : status.hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); - ImGui::RenderNavHighlight(bb, id); + ImGui::RenderNavCursor(bb, id); ImGui::RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding); ImGui::RenderTextClippedEx(