| 2353 | // Backtick works like a game console, opening the log ready to type and closing it from the command line. |
| 2354 | if (ConsoleLogTool != nullptr && ImGui::IsKeyPressed(ImGuiKey_GraveAccent, false) && ImGui::GetIO().KeyMods == ImGuiMod_None) |
| 2355 | { |
| 2356 | if (FFooterDrawer* ConsoleDrawer = FindDrawerForTool(ConsoleLogTool)) |
| 2357 | { |
| 2358 | if (ConsoleLogTool->IsCommandInputActive()) |
| 2359 | { |
| 2360 | if (!ConsoleDrawer->bDocked && OpenDrawer == ConsoleLogTool) |
| 2361 | { |
| 2362 | ActivateDrawer(*ConsoleDrawer); |
| 2363 | } |
| 2364 | } |
| 2365 | else if (!ImGui::GetIO().WantTextInput) |
| 2366 | { |
| 2367 | ShowDrawer(*ConsoleDrawer); |
| 2368 | ConsoleLogTool->FocusCommandInput(); |
| 2369 | } |
| 2370 | } |
| 2371 | } |
| 2372 | |
| 2373 | const float Scale = ImGuiX::GetUIScale(); |
| 2374 | const float BarHeight = ImGui::GetFrameHeight() + 6.0f * Scale; |
| 2375 | |
| 2376 | ImGuiViewport* Viewport = ImGui::GetMainViewport(); |
| 2377 | ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(4.0f * Scale, 0.0f)); |
| 2378 | ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2.0f * Scale, 0.0f)); |
| 2379 | ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f); |
| 2380 | ImGui::PushStyleColor(ImGuiCol_WindowBg, EditorColors::TitleBg()); |
| 2381 | if (ImGui::BeginViewportSideBar("##EditorStatusBar", Viewport, ImGuiDir_Down, BarHeight, |
| 2382 | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoNav)) |
| 2383 | { |
| 2384 | ImDrawList* DrawList = ImGui::GetWindowDrawList(); |
| 2385 | const ImVec2 BarMin = ImGui::GetWindowPos(); |
| 2386 | DrawList->AddLine(BarMin, ImVec2(BarMin.x + ImGui::GetWindowWidth(), BarMin.y), IM_COL32(0, 0, 0, 160)); |
| 2387 | |
| 2388 | const float PadX = 12.0f * Scale; |
| 2389 | const float IconGap = 7.0f * Scale; |
| 2390 | const ImU32 AccentColor = EditorColors::U32(EditorColors::Accent()); |
| 2391 | const ImU32 OpenFill = EditorColors::U32(EditorColors::WindowBg()); |
| 2392 | const ImU32 HoverFill = EditorColors::U32(EditorColors::Lighten(EditorColors::TitleBg(), 0.05f)); |
| 2393 | const ImU32 HeldFill = EditorColors::U32(EditorColors::Lighten(EditorColors::TitleBg(), 0.09f)); |
| 2394 | const ImU32 BrightText = EditorColors::U32(EditorColors::TextPrimary()); |
| 2395 | const ImU32 DimText = EditorColors::U32(EditorColors::TextDim()); |
| 2396 | |
| 2397 | for (FFooterDrawer& Drawer : FooterDrawers) |
| 2398 | { |
| 2399 | const bool bOpen = OpenDrawer == Drawer.Tool; |
| 2400 | const ImVec2 IconSize = ImGui::CalcTextSize(Drawer.Icon); |
| 2401 | const ImVec2 LabelSize = ImGui::CalcTextSize(Drawer.Label); |
| 2402 | |
| 2403 | ImGui::SetCursorPosY(0.0f); |
| 2404 | ImGui::PushID(Drawer.Label); |
| 2405 | // The drawer auto-dismisses on mouse-down, so a release toggle would re-open what the press closed. |
| 2406 | const bool bPressed = ImGui::InvisibleButton("##Drawer", ImVec2(PadX * 2.0f + IconSize.x + IconGap + LabelSize.x, BarHeight), |
| 2407 | ImGuiButtonFlags_PressedOnClick); |
| 2408 | ImGui::PopID(); |
| 2409 | |
| 2410 | const bool bHovered = ImGui::IsItemHovered(); |
| 2411 | const ImVec2 Min = ImGui::GetItemRectMin(); |
| 2412 | const ImVec2 Max = ImGui::GetItemRectMax(); |
nothing calls this directly
no test coverage detected