feat: Allow any custom content to be displayed in the command palette

This commit is contained in:
WerWolv
2025-08-15 20:17:58 +02:00
parent 0ebe4150ae
commit 762eacb7c8
9 changed files with 130 additions and 128 deletions

View File

@@ -3,9 +3,12 @@
#include <hex/api/imhex_api/system.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/api/task_manager.hpp>
#include <hex/api/events/events_provider.hpp>
#include <hex/api/events/events_gui.hpp>
#include <hex/api/events/requests_gui.hpp>
#include <hex/api/events/events_interaction.hpp>
#include <hex/api/events/requests_interaction.hpp>
#include <hex/ui/view.hpp>
#include <hex/helpers/utils.hpp>
@@ -24,7 +27,6 @@
#include <toasts/toast_notification.hpp>
#include <csignal>
#include <hex/api/events/events_interaction.hpp>
namespace hex::plugin::builtin {
@@ -423,8 +425,10 @@ namespace hex::plugin::builtin {
EventProviderChanged::subscribe([](auto, auto) { providerJustChanged = true; });
static prv::Provider *rightClickedProvider = nullptr;
EventSearchBoxClicked::subscribe([](ImGuiMouseButton button){
if (button == ImGuiMouseButton_Right) {
EventSearchBoxClicked::subscribe([](ImGuiMouseButton button) {
if (button == ImGuiMouseButton_Left) {
RequestOpenCommandPalette::post();
} else if (button == ImGuiMouseButton_Right) {
rightClickedProvider = ImHexApi::Provider::get();
RequestOpenPopup::post("ProviderMenu");
}