feat: Added command line palette option to open/focus views

This commit is contained in:
WerWolv
2025-08-08 22:36:46 +02:00
parent df1e97af0a
commit ad87f005fe
3 changed files with 39 additions and 18 deletions

View File

@@ -82,6 +82,12 @@ namespace hex {
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_NavEnableKeyboard;
}
void View::bringToFront() {
getWindowOpenState() = true;
TaskManager::doLater([this]{ ImGui::SetWindowFocus(toWindowName(getUnlocalizedName()).c_str()); });
}
std::string View::toWindowName(const UnlocalizedString &unlocalizedName) {
return fmt::format("{}###{}", Lang(unlocalizedName), unlocalizedName.get());
}