impr: Insert short delay before opening popups so the animation finishes
This commit is contained in:
parent
fdd2e1fcde
commit
aa66d4b9e7
@ -568,17 +568,26 @@ namespace hex {
|
|||||||
static bool popupDisplaying = false;
|
static bool popupDisplaying = false;
|
||||||
static bool positionSet = false;
|
static bool positionSet = false;
|
||||||
static bool sizeSet = false;
|
static bool sizeSet = false;
|
||||||
|
static double popupDelay = -2.0;
|
||||||
|
|
||||||
static std::unique_ptr<impl::PopupBase> currPopup;
|
static std::unique_ptr<impl::PopupBase> currPopup;
|
||||||
static LangEntry name("");
|
static LangEntry name("");
|
||||||
|
|
||||||
if (auto &popups = impl::PopupBase::getOpenPopups(); !popups.empty()) {
|
if (auto &popups = impl::PopupBase::getOpenPopups(); !popups.empty()) {
|
||||||
if (!ImGui::IsPopupOpen(ImGuiID(0), ImGuiPopupFlags_AnyPopupId)) {
|
if (!ImGui::IsPopupOpen(ImGuiID(0), ImGuiPopupFlags_AnyPopupId)) {
|
||||||
currPopup = std::move(popups.back());
|
if (popupDelay <= -1.0) {
|
||||||
name = LangEntry(currPopup->getUnlocalizedName());
|
popupDelay = 200;
|
||||||
|
} else {
|
||||||
|
popupDelay -= this->m_lastFrameTime;
|
||||||
|
if (popupDelay < 0) {
|
||||||
|
popupDelay = -2.0;
|
||||||
|
currPopup = std::move(popups.back());
|
||||||
|
name = LangEntry(currPopup->getUnlocalizedName());
|
||||||
|
|
||||||
ImGui::OpenPopup(name);
|
ImGui::OpenPopup(name);
|
||||||
popups.pop_back();
|
popups.pop_back();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user