feat: Allow custom UIs to be drawn in the command palette

This commit is contained in:
WerWolv
2025-08-15 17:29:00 +02:00
parent 5853cb5ad5
commit 3ed7834945
3 changed files with 55 additions and 23 deletions

View File

@@ -613,6 +613,11 @@ namespace hex {
return *s_handlers;
}
static AutoReset<std::optional<ContentDisplayCallback>> s_displayedContent;
std::optional<ContentDisplayCallback>& getDisplayedContent() {
return *s_displayedContent;
}
}
void add(Type type, const std::string &command, const UnlocalizedString &unlocalizedDescription, const impl::DisplayCallback &displayCallback, const impl::ExecuteCallback &executeCallback) {
@@ -627,6 +632,10 @@ namespace hex {
impl::s_handlers->push_back(impl::Handler { type, command, queryCallback, displayCallback });
}
void setDisplayedContent(const impl::ContentDisplayCallback &displayCallback) {
impl::s_displayedContent = displayCallback;
}
}