1
0
mirror of synced 2024-12-25 05:54:50 +01:00
ImHex/plugins/builtin/include/content/popups/popup_tasks_waiting.hpp

38 lines
1.3 KiB
C++
Raw Normal View History

2023-11-10 20:47:08 +01:00
#pragma once
#include <hex/ui/popup.hpp>
#include <hex/api/localization_manager.hpp>
#include <string>
namespace hex::plugin::builtin {
class PopupTasksWaiting : public Popup<PopupTasksWaiting> {
public:
PopupTasksWaiting()
: hex::Popup<PopupTasksWaiting>("hex.builtin.popup.waiting_for_tasks.title", false) { }
void drawContent() override {
ImGui::TextUnformatted("hex.builtin.popup.waiting_for_tasks.desc"_lang);
ImGui::Separator();
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcTextSize("[-]").x) / 2);
ImGuiExt::TextSpinner("");
ImGui::NewLine();
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - 150_scaled) / 2);
if (ImGui::ButtonEx("hex.ui.common.cancel"_lang, ImVec2(150, 0)) || ImGui::IsKeyDown(ImGuiKey_Escape))
ImGui::CloseCurrentPopup();
if (TaskManager::getRunningTaskCount() == 0 && TaskManager::getRunningBackgroundTaskCount() == 0) {
ImGui::CloseCurrentPopup();
ImHexApi::System::closeImHex();
}
}
[[nodiscard]] ImGuiWindowFlags getFlags() const override {
return ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove;
}
};
}