Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Indeterminate progress bar #5316

Closed
wants to merge 3 commits into from
Closed

Indeterminate progress bar #5316

wants to merge 3 commits into from

Conversation

gan74
Copy link
Contributor

@gan74 gan74 commented May 16, 2022

I added an option to have the progress bar display an animated indeterminate loading status in the spirit of #1901.
It works by passing a negative fraction, varying the value moves the bar (so it's easy to vary the speed of the animation).

ImGui::ProgressBar(ImGui::GetTime() * -0.25f);:
Animated
ImGui::ProgressBar(ImGui::GetTime() * -0.2f, ImVec2(0, 0), "Loading...");:
Animated
forgive the bad looping

I am not sure if modifying the existing ProgressBar implementation is the right thing to do, or if adding a new function would be preferable.

@ocornut
Copy link
Owner

ocornut commented Apr 24, 2024

Thanks for your PR. This is now merged as c895e98, with minor tweaks and update for latest (as we recently added support for NaN, #7451).
The horizontal centering of overlay was wrong because of added ItemSpacing.
Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants