| 1232 | } |
| 1233 | |
| 1234 | void PySubLayout::exit() { |
| 1235 | if (!entered_ || g_layout_stack.empty()) |
| 1236 | return; |
| 1237 | |
| 1238 | entered_ = false; |
| 1239 | const auto ctx = g_layout_stack.top(); |
| 1240 | g_layout_stack.pop(); |
| 1241 | |
| 1242 | switch (ctx.type) { |
| 1243 | case LayoutType::Split: |
| 1244 | if (ctx.child_index > 0) { |
| 1245 | ImGui::PopItemWidth(); |
| 1246 | ImGui::EndGroup(); |
| 1247 | } |
| 1248 | ImGui::EndGroup(); |
| 1249 | break; |
| 1250 | case LayoutType::Row: |
| 1251 | break; |
| 1252 | case LayoutType::Box: |
| 1253 | ImGui::EndChild(); |
| 1254 | ImGui::PopStyleColor(2); |
| 1255 | ImGui::PopStyleVar(2); |
| 1256 | break; |
| 1257 | case LayoutType::GridFlow: |
| 1258 | if (ctx.table_active) |
| 1259 | ImGui::EndTable(); |
| 1260 | break; |
| 1261 | default: |
| 1262 | break; |
| 1263 | } |
| 1264 | } |
| 1265 | |
| 1266 | void PySubLayout::advance_child() { |
| 1267 | assert(!g_layout_stack.empty() && "advance_child() called outside layout context"); |
no test coverage detected