mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 08:18:55 +00:00
Starfield: Modify speed by Plus or Minus keypresses
Although this is supposed to be a screensaver, it makes all the sense in the world that it should support modifying the speed interactively. :^)
This commit is contained in:
parent
7b923d1376
commit
efe5f37b04
Notes:
sideshowbarker
2024-07-18 00:54:25 +09:00
Author: https://github.com/pmhpereira
Commit: efe5f37b04
Pull-request: https://github.com/SerenityOS/serenity/pull/10995
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/linusg ✅
1 changed files with 12 additions and 2 deletions
|
@ -85,9 +85,19 @@ void Starfield::mousedown_event(GUI::MouseEvent&)
|
||||||
GUI::Application::the()->quit();
|
GUI::Application::the()->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Starfield::keydown_event(GUI::KeyEvent&)
|
void Starfield::keydown_event(GUI::KeyEvent& event)
|
||||||
{
|
{
|
||||||
|
switch (event.key()) {
|
||||||
|
case Key_Plus:
|
||||||
|
m_speed++;
|
||||||
|
break;
|
||||||
|
case Key_Minus:
|
||||||
|
if (--m_speed < 1)
|
||||||
|
m_speed = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
GUI::Application::the()->quit();
|
GUI::Application::the()->quit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Starfield::paint_event(GUI::PaintEvent& event)
|
void Starfield::paint_event(GUI::PaintEvent& event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue