Remove obsolete imgui functions

This commit is contained in:
Guillaume Meunier
2026-08-17 20:43:56 +02:00
parent 7448b2b22c
commit cb60fe1d94
3 changed files with 9 additions and 9 deletions
+6 -6
View File
@@ -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()
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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(