| 2946 | } |
| 2947 | |
| 2948 | void Graph::graphButtons() |
| 2949 | { |
| 2950 | ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.15f, .15f, .15f, 1.0f)); |
| 2951 | ImGui::SetWindowFontScale(_fontScale); |
| 2952 | |
| 2953 | if (ImGui::BeginMenuBar()) |
| 2954 | { |
| 2955 | if (ImGui::BeginMenu("File")) |
| 2956 | { |
| 2957 | // Buttons for loading and saving a .mtlx |
| 2958 | if (ImGui::MenuItem("New", "Ctrl-N")) |
| 2959 | { |
| 2960 | clearGraph(); |
| 2961 | } |
| 2962 | else if (ImGui::MenuItem("Open", "Ctrl-O")) |
| 2963 | { |
| 2964 | loadGraphFromFile(true); |
| 2965 | } |
| 2966 | else if (ImGui::MenuItem("Reload", "Ctrl-R")) |
| 2967 | { |
| 2968 | loadGraphFromFile(false); |
| 2969 | } |
| 2970 | else if (ImGui::MenuItem("Save", "Ctrl-S")) |
| 2971 | { |
| 2972 | saveGraphToFile(); |
| 2973 | } |
| 2974 | ImGui::EndMenu(); |
| 2975 | } |
| 2976 | |
| 2977 | if (ImGui::BeginMenu("Graph")) |
| 2978 | { |
| 2979 | if (ImGui::MenuItem("Auto Layout")) |
| 2980 | { |
| 2981 | _autoLayout = true; |
| 2982 | _needsNavigation = true; |
| 2983 | } |
| 2984 | ImGui::Separator(); |
| 2985 | Layout::Options& opts = _layout.options; |
| 2986 | if (ImGui::Checkbox("Insert Virtual Nodes", &opts.insertVirtualNodes)) |
| 2987 | { |
| 2988 | _autoLayout = true; |
| 2989 | _needsNavigation = true; |
| 2990 | } |
| 2991 | if (ImGui::Checkbox("Minimize Crossings", &opts.minimizeCrossings)) |
| 2992 | { |
| 2993 | _autoLayout = true; |
| 2994 | _needsNavigation = true; |
| 2995 | } |
| 2996 | if (ImGui::Checkbox("Refine Positions", &opts.refinePositions)) |
| 2997 | { |
| 2998 | _autoLayout = true; |
| 2999 | _needsNavigation = true; |
| 3000 | } |
| 3001 | ImGui::EndMenu(); |
| 3002 | } |
| 3003 | |
| 3004 | if (ImGui::BeginMenu("Viewer")) |
| 3005 | { |
nothing calls this directly
no test coverage detected