hide menu bar from menu bar (#2988)

* hide menu bar from menu bar

* show `-` on switch/wii u

* actually show `-`

* actually put the thing in a place where it works

* spacers

* reorder and use `[-]` instead of `-`

---------

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
briaguya 2023-06-14 23:22:48 -04:00 committed by GitHub
parent af33897e4c
commit ccfc2a84bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,20 +120,35 @@ void DrawMenuBarIcon() {
void DrawShipMenu() { void DrawShipMenu() {
if (ImGui::BeginMenu("Ship")) { if (ImGui::BeginMenu("Ship")) {
if (ImGui::MenuItem("Hide Menu Bar",
#if !defined(__SWITCH__) && !defined(__WIIU__)
"F1"
#else
"[-]"
#endif
)) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetMenuBar()->ToggleVisibility();
}
UIWidgets::Spacer(0);
#if !defined(__SWITCH__) && !defined(__WIIU__)
if (ImGui::MenuItem("Toggle Fullscreen", "F11")) {
LUS::Context::GetInstance()->GetWindow()->ToggleFullscreen();
}
UIWidgets::Spacer(0);
#endif
if (ImGui::MenuItem("Reset", if (ImGui::MenuItem("Reset",
#ifdef __APPLE__ #ifdef __APPLE__
"Command-R" "Command-R"
#else #elif !defined(__SWITCH__) && !defined(__WIIU__)
"Ctrl+R" "Ctrl+R"
#else
""
#endif #endif
)) { )) {
std::reinterpret_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); std::reinterpret_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset");
} }
#if !defined(__SWITCH__) && !defined(__WIIU__) #if !defined(__SWITCH__) && !defined(__WIIU__)
auto backend = LUS::Context::GetInstance()->GetWindow()->GetWindowBackend(); UIWidgets::Spacer(0);
if (ImGui::MenuItem("Toggle Fullscreen", "F11")) {
LUS::Context::GetInstance()->GetWindow()->ToggleFullscreen();
}
if (ImGui::MenuItem("Quit")) { if (ImGui::MenuItem("Quit")) {
LUS::Context::GetInstance()->GetWindow()->Close(); LUS::Context::GetInstance()->GetWindow()->Close();
} }