1
0
mirror of synced 2025-01-19 01:24:15 +01:00
ImHex/plugins/builtin/include/content/popups/popup_tasks_waiting.hpp
iTrooz 39252dfe48
refactor: Move custom ImGui functions to ImGuiExt namespace (#1427)
Co-authored-by: Nik <werwolv98@gmail.com>
2023-11-16 22:24:06 +01:00

38 lines
1.3 KiB
C++

#pragma once
#include <hex/ui/popup.hpp>
#include <hex/api/localization.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.builtin.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;
}
};
}