Progress Indicators (spinner + loading bar)
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): ```c++ 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(
Posted by zfedoran on Jun 25, 2018, 5:41 AM
Tags
Related issues
- struct's lifetime requirements can be bypassed via covariant field assignment
- Proposal to Reorganize the Moderation Team and Review Moderation Policies
- Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
- proposal: container/...: generic collection types
- Better Custom Endpoint BYOK
- A concrete policy for backward compatibility until Godot 5.0
Raise real-world problems, find people facing the same issue, and discuss solutions.4,000 issues0 comments
github (Other)
struct's lifetime requirements can be bypassed via covariant field assignment
Proposal to Reorganize the Moderation Team and Review Moderation Policies
Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
proposal: container/...: generic collection types
Better Custom Endpoint BYOK
A concrete policy for backward compatibility until Godot 5.0
New MTP models not supported
Tracking: 429 / Capacity Issues
Progress Indicators (spinner + loading bar)
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): ```c++ 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(
Comments (0)
No comments yet. Start the discussion.