mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Make close button on macOS close providers if any are open instead of closing ImHex
This commit is contained in:
@@ -10,8 +10,9 @@ namespace hex::plugin::builtin {
|
||||
|
||||
class PopupTasksWaiting : public Popup<PopupTasksWaiting> {
|
||||
public:
|
||||
PopupTasksWaiting()
|
||||
: hex::Popup<PopupTasksWaiting>("hex.builtin.popup.waiting_for_tasks.title", false) { }
|
||||
PopupTasksWaiting(std::function<void()> onFinish)
|
||||
: hex::Popup<PopupTasksWaiting>("hex.builtin.popup.waiting_for_tasks.title", false),
|
||||
m_onFinish(std::move(onFinish)){ }
|
||||
|
||||
void drawContent() override {
|
||||
ImGui::TextUnformatted("hex.builtin.popup.waiting_for_tasks.desc"_lang);
|
||||
@@ -26,13 +27,16 @@ namespace hex::plugin::builtin {
|
||||
|
||||
if (TaskManager::getRunningTaskCount() == 0 && TaskManager::getRunningBackgroundTaskCount() == 0) {
|
||||
ImGui::CloseCurrentPopup();
|
||||
ImHexApi::System::closeImHex();
|
||||
m_onFinish();
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] ImGuiWindowFlags getFlags() const override {
|
||||
return ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove;
|
||||
}
|
||||
|
||||
private:
|
||||
std::function<void()> m_onFinish;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user