diff --git a/src/surge-xt/gui/SurgeGUIEditor.cpp b/src/surge-xt/gui/SurgeGUIEditor.cpp index c1685299047..f6766a9f200 100644 --- a/src/surge-xt/gui/SurgeGUIEditor.cpp +++ b/src/surge-xt/gui/SurgeGUIEditor.cpp @@ -3916,42 +3916,50 @@ juce::PopupMenu SurgeGUIEditor::makeZoomMenu(const juce::Point &where, bool }, zoomStatus); }); + } + + if (Surge::GUI::getIsStandalone()) + { + juce::Component *comp = frame.get(); - if (Surge::GUI::getIsStandalone()) + while (comp) { - juce::Component *comp = frame.get(); - while (comp) + auto *cdw = dynamic_cast(comp); + + if (cdw) { - auto *cdw = dynamic_cast(comp); - if (cdw) + zoomSubMenu.addSeparator(); + + if (cdw->isFullScreen()) { - zoomSubMenu.addSeparator(); - if (cdw->isFullScreen()) - { - zoomSubMenu.addItem("Exit Full Screen", - [this, w = juce::Component::SafePointer(cdw)]() { - if (w) - { - w->setFullScreen(false); - } - }); - } - else - { - zoomSubMenu.addItem("Enter Full Screen", - [w = juce::Component::SafePointer(cdw)]() { - if (w) - { - w->setFullScreen(true); - } - }); - } - comp = nullptr; + Surge::GUI::addMenuWithShortcut( + zoomSubMenu, Surge::GUI::toOSCase("Exit Fullscreen Mode"), + showShortcutDescription("F11"), + [this, w = juce::Component::SafePointer(cdw)]() { + if (w) + { + w->setFullScreen(false); + } + }); } else { - comp = comp->getParentComponent(); + Surge::GUI::addMenuWithShortcut( + zoomSubMenu, Surge::GUI::toOSCase("Enter Fullscreen Mode"), + showShortcutDescription("F11"), + [this, w = juce::Component::SafePointer(cdw)]() { + if (w) + { + w->setFullScreen(true); + } + }); } + + comp = nullptr; + } + else + { + comp = comp->getParentComponent(); } } } @@ -7423,6 +7431,11 @@ void SurgeGUIEditor::setupKeymapManager() keyMapManager->addBinding(Surge::GUI::ZOOM_MINUS_10, {keymap_t::Modifiers::NONE, '-'}); keyMapManager->addBinding(Surge::GUI::ZOOM_MINUS_25, {keymap_t::Modifiers::SHIFT, '-'}); + if (Surge::GUI::getIsStandalone()) + { + keyMapManager->addBinding(Surge::GUI::ZOOM_FULLSCREEN, {juce::KeyPress::F11Key}); + } + keyMapManager->addBinding(Surge::GUI::FOCUS_NEXT_CONTROL_GROUP, {keymap_t::Modifiers::ALT, (int)'.'}); keyMapManager->addBinding(Surge::GUI::FOCUS_PRIOR_CONTROL_GROUP, @@ -7651,10 +7664,43 @@ bool SurgeGUIEditor::keyPressed(const juce::KeyPress &key, juce::Component *orig ? -1 : 1; auto jog = zl * di; + resizeWindow(getZoomFactor() + jog); + return true; } + case Surge::GUI::ZOOM_FULLSCREEN: + { + if (Surge::GUI::getIsStandalone()) + { + juce::Component *comp = frame.get(); + + while (comp) + { + auto *cdw = dynamic_cast(comp); + + if (cdw) + { + auto w = juce::Component::SafePointer(cdw); + + if (w) + { + w->setFullScreen(!cdw->isFullScreen()); + } + + comp = nullptr; + } + else + { + comp = comp->getParentComponent(); + } + } + return true; + } + + return false; + } case Surge::GUI::FOCUS_NEXT_CONTROL_GROUP: case Surge::GUI::FOCUS_PRIOR_CONTROL_GROUP: { diff --git a/src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h b/src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h index b4f7974986d..5cb2035057c 100644 --- a/src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h +++ b/src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h @@ -75,6 +75,7 @@ enum KeyboardActions ZOOM_PLUS_25, ZOOM_MINUS_10, ZOOM_MINUS_25, + ZOOM_FULLSCREEN, FOCUS_NEXT_CONTROL_GROUP, FOCUS_PRIOR_CONTROL_GROUP, @@ -169,6 +170,8 @@ inline std::string keyboardActionName(KeyboardActions a) return "ZOOM_MINUS_10"; case ZOOM_MINUS_25: return "ZOOM_MINUS_25"; + case ZOOM_FULLSCREEN: + return "ZOOM_FULLSCREEN"; case REFRESH_SKIN: return "REFRESH_SKIN"; @@ -303,19 +306,22 @@ inline std::string keyboardActionDescription(KeyboardActions a) break; case ZOOM_TO_DEFAULT: - desc = "Zoom to Default"; + desc = Surge::GUI::toOSCase("Zoom: ") + Surge::GUI::toOSCase("Default"); break; case ZOOM_PLUS_10: - desc = "Zoom +10%"; + desc = "Zoom: +10%"; break; case ZOOM_PLUS_25: - desc = "Zoom +25%"; + desc = "Zoom: +25%"; break; case ZOOM_MINUS_10: - desc = "Zoom -10%"; + desc = "Zoom: -10%"; break; case ZOOM_MINUS_25: - desc = "Zoom -25%"; + desc = "Zoom: -25%"; + break; + case ZOOM_FULLSCREEN: + desc = Surge::GUI::toOSCase("Zoom: ") + Surge::GUI::toOSCase("Toggle Fullscreen"); break; case REFRESH_SKIN: