34 im::Menu(
"Connectors", motherBoard !=
nullptr, [&]{
38 for (
const auto* connector : pluggingController.getConnectors()) {
39 if (ImGui::TableNextColumn()) {
42 if (ImGui::TableNextColumn()) {
43 const auto& connectorName = connector->getName();
44 auto connectorClass = connector->getClass();
45 const auto& currentPluggable = connector->getPlugged();
46 ImGui::SetNextItemWidth(ImGui::GetFontSize() * 12.0f);
47 im::Combo(
tmpStrCat(
"##", connectorName).c_str(), pluggableToGuiString(currentPluggable.getName()).c_str(), [&]{
48 if (!currentPluggable.getName().empty()) {
49 if (ImGui::Selectable(
"[unplug]")) {
50 manager.executeDelayed(makeTclList(
"unplug", connectorName));
53 for (
auto& plug : pluggables) {
54 if (plug->getClass() != connectorClass)
continue;
55 auto plugName = plug->getName();
56 bool selected = plug.get() == ¤tPluggable;
57 int flags = !selected && plug->getConnector() ? ImGuiSelectableFlags_Disabled : 0;
58 if (ImGui::Selectable(pluggableToGuiString(plugName).c_str(), selected, flags)) {
64 if (
const auto& desc = currentPluggable.getDescription(); !desc.empty()) {
void Table(const char *str_id, int column, ImGuiTableFlags flags, const ImVec2 &outer_size, float inner_width, std::invocable<> auto next)