| 121 | } |
| 122 | |
| 123 | void GenomeEditorWindow::processToolbar() |
| 124 | { |
| 125 | if (_tabDatas.empty()) { |
| 126 | return; |
| 127 | } |
| 128 | auto& selectedTab = _tabDatas.at(_selectedTabIndex); |
| 129 | |
| 130 | if (AlienImGui::ToolbarButton(AlienImGui::ToolbarButtonParameters().text(ICON_FA_FOLDER_OPEN))) { |
| 131 | onOpenGenome(); |
| 132 | } |
| 133 | AlienImGui::Tooltip("Open genome from file"); |
| 134 | |
| 135 | ImGui::SameLine(); |
| 136 | if (AlienImGui::ToolbarButton(AlienImGui::ToolbarButtonParameters().text(ICON_FA_SAVE))) { |
| 137 | onSaveGenome(); |
| 138 | } |
| 139 | AlienImGui::Tooltip("Save genome to file"); |
| 140 | |
| 141 | ImGui::SameLine(); |
| 142 | if (AlienImGui::ToolbarButton(AlienImGui::ToolbarButtonParameters().text(ICON_FA_UPLOAD))) { |
| 143 | onUploadGenome(); |
| 144 | } |
| 145 | AlienImGui::Tooltip("Share your genome with other users:\nYour current genome will be uploaded to the server and made visible in the browser."); |
| 146 | |
| 147 | ImGui::SameLine(); |
| 148 | AlienImGui::ToolbarSeparator(); |
| 149 | |
| 150 | ImGui::SameLine(); |
| 151 | if (AlienImGui::ToolbarButton(AlienImGui::ToolbarButtonParameters().text(ICON_FA_COPY))) { |
| 152 | _copiedGenome = GenomeDescriptionService::get().convertDescriptionToBytes(selectedTab.genome); |
| 153 | printOverlayMessage("Genome copied"); |
| 154 | } |
| 155 | AlienImGui::Tooltip("Copy genome"); |
| 156 | |
| 157 | ImGui::SameLine(); |
| 158 | AlienImGui::ToolbarSeparator(); |
| 159 | |
| 160 | ImGui::SameLine(); |
| 161 | if (AlienImGui::ToolbarButton(AlienImGui::ToolbarButtonParameters().text(ICON_FA_PLUS))) { |
| 162 | onAddNode(); |
| 163 | } |
| 164 | AlienImGui::Tooltip("Add cell"); |
| 165 | |
| 166 | ImGui::SameLine(); |
| 167 | ImGui::BeginDisabled(selectedTab.genome.cells.empty()); |
| 168 | if (AlienImGui::ToolbarButton(AlienImGui::ToolbarButtonParameters().text(ICON_FA_MINUS))) { |
| 169 | onDeleteNode(); |
| 170 | } |
| 171 | ImGui::EndDisabled(); |
| 172 | AlienImGui::Tooltip("Delete cell"); |
| 173 | |
| 174 | ImGui::SameLine(); |
| 175 | AlienImGui::ToolbarSeparator(); |
| 176 | |
| 177 | ImGui::SameLine(); |
| 178 | auto& selectedNode = selectedTab.selectedNode; |
| 179 | ImGui::BeginDisabled(!(selectedNode && *selectedNode > 0)); |
| 180 | if (AlienImGui::ToolbarButton(AlienImGui::ToolbarButtonParameters().text(ICON_FA_CHEVRON_UP))) { |
nothing calls this directly
no test coverage detected