mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +00:00
LibGUI: Ignore keyboard and mouse events in disabled widgets
This commit is contained in:
parent
e4f433dddd
commit
6fa104ffd3
1 changed files with 15 additions and 0 deletions
|
@ -158,6 +158,21 @@ void Widget::set_relative_rect(const Gfx::Rect& a_rect)
|
|||
|
||||
void Widget::event(Core::Event& event)
|
||||
{
|
||||
if (!is_enabled()) {
|
||||
switch (event.type()) {
|
||||
case Event::MouseUp:
|
||||
case Event::MouseDown:
|
||||
case Event::MouseMove:
|
||||
case Event::MouseWheel:
|
||||
case Event::MouseDoubleClick:
|
||||
case Event::KeyUp:
|
||||
case Event::KeyDown:
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (event.type()) {
|
||||
case Event::Paint:
|
||||
return handle_paint_event(static_cast<PaintEvent&>(event));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue