mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 09:36:08 +00:00
3DFileViewer: Allow escape key to exit fullscreen mode
I went into fullscreen mode, via the View menu, before looking at the associated key (F11). I had to kill Qemu to be able to escape. Escape is an intuitive way to exit most fullscreen modes.
This commit is contained in:
parent
659a7a5da7
commit
2ecc608dea
Notes:
sideshowbarker
2024-07-17 16:18:44 +09:00
Author: https://github.com/adamrt 🔰
Commit: 2ecc608dea
Pull-request: https://github.com/SerenityOS/serenity/pull/13392
Reviewed-by: https://github.com/bgianfo
1 changed files with 9 additions and 0 deletions
|
@ -97,6 +97,7 @@ private:
|
||||||
virtual void timer_event(Core::TimerEvent&) override;
|
virtual void timer_event(Core::TimerEvent&) override;
|
||||||
virtual void mousemove_event(GUI::MouseEvent&) override;
|
virtual void mousemove_event(GUI::MouseEvent&) override;
|
||||||
virtual void mousewheel_event(GUI::MouseEvent&) override;
|
virtual void mousewheel_event(GUI::MouseEvent&) override;
|
||||||
|
virtual void keydown_event(GUI::KeyEvent&) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RefPtr<Mesh> m_mesh;
|
RefPtr<Mesh> m_mesh;
|
||||||
|
@ -183,6 +184,14 @@ void GLContextWidget::mousewheel_event(GUI::MouseEvent& event)
|
||||||
m_zoom *= 1.1f;
|
m_zoom *= 1.1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLContextWidget::keydown_event(GUI::KeyEvent& event)
|
||||||
|
{
|
||||||
|
if (event.key() == Key_Escape && window()->is_fullscreen()) {
|
||||||
|
window()->set_fullscreen(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GLContextWidget::timer_event(Core::TimerEvent&)
|
void GLContextWidget::timer_event(Core::TimerEvent&)
|
||||||
{
|
{
|
||||||
auto timer = Core::ElapsedTimer::start_new();
|
auto timer = Core::ElapsedTimer::start_new();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue