mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -05:00
feat: Added command line palette option to open/focus views
This commit is contained in:
@@ -405,7 +405,7 @@ namespace hex::plugin::builtin {
|
||||
return result;
|
||||
},
|
||||
[](auto input) {
|
||||
return fmt::format("Provider: {}", input.data());
|
||||
return fmt::format("Data Source: {}", input.data());
|
||||
});
|
||||
|
||||
ContentRegistry::CommandPaletteCommands::add(
|
||||
@@ -414,6 +414,27 @@ namespace hex::plugin::builtin {
|
||||
"hex.builtin.command.convert.desc",
|
||||
handleConversionCommand);
|
||||
|
||||
ContentRegistry::CommandPaletteCommands::addHandler(
|
||||
ContentRegistry::CommandPaletteCommands::Type::SymbolCommand,
|
||||
"+",
|
||||
[](const auto &input) {
|
||||
std::vector<ContentRegistry::CommandPaletteCommands::impl::QueryResult> result;
|
||||
|
||||
for (const auto &[unlocalizedName, view] : ContentRegistry::Views::impl::getEntries()) {
|
||||
const auto name = Lang(unlocalizedName);
|
||||
if (!hex::containsIgnoreCase(name, input))
|
||||
continue;
|
||||
result.emplace_back(fmt::format("Focus {} View", name), [&view](const auto &) {
|
||||
view->bringToFront();
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
[](auto input) {
|
||||
return fmt::format("Focus {} View", input.data());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user