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