| 69 | } |
| 70 | |
| 71 | void drawSelectionContextMenu(UiState& uiState) { |
| 72 | constexpr const char* kPopupId = "##selection_context_menu"; |
| 73 | |
| 74 | if (uiState.openSelectionContextMenu) { |
| 75 | ImGui::SetNextWindowPos(ImVec2(uiState.selectionContextMenuX, uiState.selectionContextMenuY)); |
| 76 | ImGui::OpenPopup(kPopupId); |
| 77 | uiState.openSelectionContextMenu = false; |
| 78 | } |
| 79 | |
| 80 | if (ImGui::BeginPopup(kPopupId)) { |
| 81 | if (ImGui::MenuItem("Зафиксировать")) { |
| 82 | ToolsManager::setSelectedAtomsFixed(true); |
| 83 | } |
| 84 | if (ImGui::MenuItem("Отфиксировать")) { |
| 85 | ToolsManager::setSelectedAtomsFixed(false); |
| 86 | } |
| 87 | ImGui::EndPopup(); |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | Interface::Interface(GLFWwindow* w, Lattice::Simulation& s, std::unique_ptr<BaseRenderer>& r, CaptureController& c) |