mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
Piano: Use CObject::custom_event() to simplify PianoWidget a bit.
This commit is contained in:
parent
a634fab3c4
commit
2a9b627ae9
Notes:
sideshowbarker
2024-07-19 13:16:44 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2a9b627ae9a
2 changed files with 3 additions and 6 deletions
|
@ -355,10 +355,7 @@ void PianoWidget::render_knobs(GPainter& painter)
|
|||
painter.draw_text(wave_knob_rect, wave_name, TextAlignment::Center, Color(r, g, b));
|
||||
}
|
||||
|
||||
void PianoWidget::event(CEvent& event)
|
||||
void PianoWidget::custom_event(CCustomEvent&)
|
||||
{
|
||||
if (event.type() == CEvent::Custom) {
|
||||
update();
|
||||
}
|
||||
GWidget::event(event);
|
||||
update();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ private:
|
|||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void keydown_event(GKeyEvent&) override;
|
||||
virtual void keyup_event(GKeyEvent&) override;
|
||||
virtual void event(CEvent&) override;
|
||||
virtual void custom_event(CCustomEvent&) override;
|
||||
|
||||
double w_sine(size_t);
|
||||
double w_saw(size_t);
|
||||
|
|
Loading…
Add table
Reference in a new issue