Clarify ImGui activation in Editor viewport (#1765)

* Clarify ImGui activation in Editor viewport

Signed-off-by: John Jones-Steele <jjjoness@amazon.com>

* All working following changes from comments in PR

Signed-off-by: John Jones-Steele <jjjoness@amazon.com>

* One more change

Signed-off-by: John Jones-Steele <jjjoness@amazon.com>

* fixes from comments in PR.

Signed-off-by: John Jones-Steele <jjjoness@amazon.com>

* Fixed git merge error

Signed-off-by: John Jones-Steele <jjjoness@amazon.com>

* Added header to ImGuiBus.h

Signed-off-by: John Jones-Steele <jjjoness@amazon.com>

* Fix for Jenkins error

Signed-off-by: John Jones-Steele <jjjoness@amazon.com>

* Minor typo fix

Signed-off-by: John Jones-Steele <jjjoness@amazon.com>
This commit is contained in:
jjjoness
2021-07-09 18:03:20 +01:00
committed by GitHub
parent 76cef6e91f
commit 1b530195fc
17 changed files with 201 additions and 18 deletions
@@ -571,7 +571,26 @@ namespace ImGui
// End LY Common Tools menu
ImGui::EndMenu();
}
const int labelSize{ 100 };
const int buttonSize{ 40 };
ImGuiUpdateListenerBus::Broadcast(&IImGuiUpdateListener::OnImGuiMainMenuUpdate);
ImGui::SameLine(ImGui::GetWindowContentRegionMax().x - labelSize);
float backgroundHeight = ImGui::GetTextLineHeight() + 3;
ImVec2 cursorPos = ImGui::GetCursorScreenPos();
ImGui::GetWindowDrawList()->AddRectFilled(
cursorPos, ImVec2(cursorPos.x + labelSize, cursorPos.y + backgroundHeight), IM_COL32(0, 115, 187, 255));
ImGui::SameLine(ImGui::GetWindowContentRegionMax().x - labelSize);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() - 1);
ImGui::Text("ImGui:ON");
ImGui::SameLine(ImGui::GetWindowContentRegionMax().x - buttonSize);
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 0, 0, 255));
ImGui::PushStyleColor(ImGuiCol_Button, IM_COL32(255, 255, 255, 255));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, IM_COL32(128, 128, 128, 255));
if (ImGui::SmallButton("home"))
{
ImGuiManagerBus::Broadcast(&IImGuiManager::ToggleThroughImGuiVisibleState);
}
ImGui::PopStyleColor(3);
ImGui::EndMainMenuBar();
}