mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
impr: Show OS toast popup when a task finishes while ImHex is not focused
This commit is contained in:
@@ -206,6 +206,13 @@ namespace hex::plugin::builtin {
|
||||
ui::ToastError::open(fmt::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
|
||||
}
|
||||
});
|
||||
} else if (name == "Open Folder") {
|
||||
fs::openFileBrowser(fs::DialogMode::Folder, { },
|
||||
[](const auto &path) {
|
||||
if (!ProjectFile::load(path)) {
|
||||
ui::ToastError::open(fmt::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -420,6 +427,11 @@ namespace hex::plugin::builtin {
|
||||
#endif
|
||||
});
|
||||
|
||||
TaskManager::addTaskCompletionCallback([](Task &task) {
|
||||
if (!glfwGetWindowAttrib(ImHexApi::System::getMainWindowHandle(), GLFW_FOCUSED) && !task.isBackgroundTask())
|
||||
hex::showToastMessage("ImHex", fmt::format("hex.builtin.os_toast_message.task_finished"_lang, Lang(task.getUnlocalizedName())));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user