CARVIEW |
Select Language
HTTP/2 200
date: Thu, 24 Jul 2025 21:37:14 GMT
content-type: text/html; charset=utf-8
cache-control: max-age=0, private, must-revalidate
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
link: ; rel=preload; as=fetch; crossorigin=use-credentials
referrer-policy: no-referrer-when-downgrade
server-timing: issue_layout-fragment;desc="issue_layout fragment";dur=208.59039,issue_conversation_content-fragment;desc="issue_conversation_content fragment";dur=711.911332,issue_conversation_sidebar-fragment;desc="issue_conversation_sidebar fragment";dur=41.840573,nginx;desc="NGINX";dur=1.150115,glb;desc="GLB";dur=102.753
strict-transport-security: max-age=31536000; includeSubdomains; preload
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With, Accept,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-voltron-version: a2eb102
x-xss-protection: 0
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=ejHHBTpw%2BHn3GXVM%2BGcuMsnAyQybZiTInTYwWSG3Na2bnMvGMvFBDObjQ3uQayBPrISCrmUoXEMDnb4pHgK8WlK1Bvms3digzf2SIDYtXctbMI0azRIptwG2eMVue29PlL4umNuXCL48avU2qQMqCGiwuzdNpoTLiDVh28xaGZnyIhkubZ3R7sMRwCnDSCQ7h%2F%2BOfVuxzVolVyPSo7n3NE6y3AaqB5kQ02Txe%2Fs1Heh5%2F6XVm4DgCqNdYYaufQAeTUoWVvBmp1GQ855If226pg%3D%3D--zfx7HXqNjPCQj0wK--fln81jJbcqr2hyXR5wceXA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1688043655.1753393033; Path=/; Domain=github.com; Expires=Fri, 24 Jul 2026 21:37:13 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 24 Jul 2026 21:37:13 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 8078:0A5B:1429F5:1AACE3:6882A789
Progress Indicators (spinner + loading bar) Β· Issue #1901 Β· ocornut/imgui Β· GitHub
No one assignedNo projectsNo milestoneNone yetNo branches or pull requests
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Open
Labels
Description
Thought someone else might find these useful. Please feel free to use / change or upgrade code as needed. These are rough but work well enough for my use. (Note: Loosely inspired by Material Design.)
Screenshots/Video
If you do change them, please post your versions, I'd love to see what you come up with.
Full Code (usage example can be found below):
namespace ImGui {
bool BufferingBar(const char* label, float value, const ImVec2& size_arg, const ImU32& bg_col, const ImU32& fg_col) {
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
ImVec2 pos = window->DC.CursorPos;
ImVec2 size = size_arg;
size.x -= style.FramePadding.x * 2;
const ImRect bb(pos, ImVec2(pos.x + size.x, pos.y + size.y));
ItemSize(bb, style.FramePadding.y);
if (!ItemAdd(bb, id))
return false;
// Render
const float circleStart = size.x * 0.7f;
const float circleEnd = size.x;
const float circleWidth = circleEnd - circleStart;
window->DrawList->AddRectFilled(bb.Min, ImVec2(pos.x + circleStart, bb.Max.y), bg_col);
window->DrawList->AddRectFilled(bb.Min, ImVec2(pos.x + circleStart*value, bb.Max.y), fg_col);
const float t = g.Time;
const float r = size.y / 2;
const float speed = 1.5f;
const float a = speed*0;
const float b = speed*0.333f;
const float c = speed*0.666f;
const float o1 = (circleWidth+r) * (t+a - speed * (int)((t+a) / speed)) / speed;
const float o2 = (circleWidth+r) * (t+b - speed * (int)((t+b) / speed)) / speed;
const float o3 = (circleWidth+r) * (t+c - speed * (int)((t+c) / speed)) / speed;
window->DrawList->AddCircleFilled(ImVec2(pos.x + circleEnd - o1, bb.Min.y + r), r, bg_col);
window->DrawList->AddCircleFilled(ImVec2(pos.x + circleEnd - o2, bb.Min.y + r), r, bg_col);
window->DrawList->AddCircleFilled(ImVec2(pos.x + circleEnd - o3, bb.Min.y + r), r, bg_col);
}
bool Spinner(const char* label, float radius, int thickness, const ImU32& color) {
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
ImVec2 pos = window->DC.CursorPos;
ImVec2 size((radius )*2, (radius + style.FramePadding.y)*2);
const ImRect bb(pos, ImVec2(pos.x + size.x, pos.y + size.y));
ItemSize(bb, style.FramePadding.y);
if (!ItemAdd(bb, id))
return false;
// Render
window->DrawList->PathClear();
int num_segments = 30;
int start = abs(ImSin(g.Time*1.8f)*(num_segments-5));
const float a_min = IM_PI*2.0f * ((float)start) / (float)num_segments;
const float a_max = IM_PI*2.0f * ((float)num_segments-3) / (float)num_segments;
const ImVec2 centre = ImVec2(pos.x+radius, pos.y+radius+style.FramePadding.y);
for (int i = 0; i < num_segments; i++) {
const float a = a_min + ((float)i / (float)num_segments) * (a_max - a_min);
window->DrawList->PathLineTo(ImVec2(centre.x + ImCos(a+g.Time*8) * radius,
centre.y + ImSin(a+g.Time*8) * radius));
}
window->DrawList->PathStroke(color, false, thickness);
}
}
Version/Branch of Dear ImGui: dear imgui, v1.62 WIP
Standalone, minimal, complete and verifiable example:
ImGui::Begin("Progress Indicators");
const ImU32 col = ImGui::GetColorU32(ImGuiCol_ButtonHovered);
const ImU32 bg = ImGui::GetColorU32(ImGuiCol_Button);
ImGui::Spinner("##spinner", 15, 6, col);
ImGui::BufferingBar("##buffer_bar", 0.7f, ImVec2(400, 6), bg, col);
ImGui::End();
edit (June 25th): Updated code based on feedback provided (#1901 (comment))
RamiAwar, Jacckii, selimanac, Matheus-Garbelini, sgf and 22 moreshahroozleon01ocornut, Pagghiu, devkaiwang, ice1000, obfuscate and 32 morenclettiere, HackAssIa, ridhwandll, Azvf, Patitotective and 2 more
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
Issue actions
You canβt perform that action at this time.