Merge branch 'main' into 2027

This commit is contained in:
Peter Johnson
2025-01-16 23:17:59 -08:00
92 changed files with 2748 additions and 534 deletions

View File

@@ -1102,7 +1102,15 @@ static void DriverStationExecute() {
}
ImGui::SetNextWindowPos(ImVec2{5, 20}, ImGuiCond_FirstUseEver);
ImGui::Begin("Robot State", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
const char* title = "Robot State";
// Accounts for size of title and collapse button
float minWidth = ImGui::CalcTextSize(title).x + ImGui::GetFontSize() +
ImGui::GetStyle().ItemInnerSpacing.x * 2 +
ImGui::GetStyle().FramePadding.x * 2 +
ImGui::GetStyle().WindowBorderSize;
ImGui::SetNextWindowSizeConstraints(ImVec2{minWidth, 0},
ImVec2{FLT_MAX, FLT_MAX});
ImGui::Begin(title, nullptr, ImGuiWindowFlags_AlwaysAutoResize);
if (ImGui::Selectable("Disconnected", !isAttached)) {
HALSIM_SetDriverStationEnabled(false);
HALSIM_SetDriverStationDsAttached(false);