mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-20 21:26:43 +00:00
Add fullscreen support to Atlas
Add a fullscreen toggle to the View menu and with a global hotkey, reusing the default one from the main game. Unlike the current implementation this one doesn't need the game canvas to be focused and also works on GTK. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -202,16 +202,6 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
// Alt+enter toggles fullscreen
|
||||
if (evt.GetKeyCode() == WXK_RETURN && wxGetKeyState(WXK_ALT))
|
||||
{
|
||||
if (m_ScenarioEditor.IsFullScreen())
|
||||
m_ScenarioEditor.ShowFullScreen(false);
|
||||
else
|
||||
m_ScenarioEditor.ShowFullScreen(true, wxFULLSCREEN_NOBORDER | wxFULLSCREEN_NOCAPTION);
|
||||
return;
|
||||
}
|
||||
|
||||
if (evt.GetKeyCode() == 'c')
|
||||
{
|
||||
POST_MESSAGE(CameraReset, ());
|
||||
@@ -520,6 +510,8 @@ ScenarioEditor::ScenarioEditor(wxWindow* parent)
|
||||
menuView->AppendCheckItem(ID_Wireframe, _("&Wireframe"));
|
||||
menuView->AppendCheckItem(ID_SmoothFramerate, _("Smooth framerate"));
|
||||
menuView->AppendCheckItem(ID_BirdsEyeView, _("&Birds Eye View\tCtrl+B"));
|
||||
auto* fullscreenItem = menuView->AppendCheckItem(wxID_ANY, _("&Fullscreen\tAlt+Enter"));
|
||||
this->Bind(wxEVT_MENU, [this, fullscreenItem](auto&){ SetFullscreen(fullscreenItem->IsChecked()); });
|
||||
menuView->Append(ID_CameraReset, _("&Reset camera"));
|
||||
}
|
||||
|
||||
@@ -1006,6 +998,11 @@ void ScenarioEditor::OnBirdsEyeView(wxCommandEvent& event)
|
||||
POST_MESSAGE(SetBirdsEyeView, (event.IsChecked()));
|
||||
}
|
||||
|
||||
void ScenarioEditor::SetFullscreen(const bool enabled)
|
||||
{
|
||||
ShowFullScreen(enabled, wxFULLSCREEN_NOBORDER | wxFULLSCREEN_NOCAPTION);
|
||||
}
|
||||
|
||||
void ScenarioEditor::OnDumpState(wxCommandEvent& event)
|
||||
{
|
||||
wxDateTime time = wxDateTime::Now();
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
void OnWireframe(wxCommandEvent& event);
|
||||
void OnSmoothFramerate(wxCommandEvent& event);
|
||||
void OnBirdsEyeView(wxCommandEvent& event);
|
||||
void SetFullscreen(const bool enabled);
|
||||
void OnCameraReset(wxCommandEvent& event);
|
||||
|
||||
void OnMessageTrace(wxCommandEvent& event);
|
||||
|
||||
Reference in New Issue
Block a user