mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 22:05:06 +00:00
LibGUI: Add a way to highlight the focused widget for debugging
You can now pass --gui-focus-debug to any GUI::Application and it will draw a cyan rectangle around the currently focused widget.
This commit is contained in:
parent
e064999e0d
commit
39d55d1d76
3 changed files with 18 additions and 2 deletions
|
@ -242,6 +242,13 @@ void Widget::handle_paint_event(PaintEvent& event)
|
|||
Painter painter(*this);
|
||||
painter.draw_rect(rect(), Color::Magenta);
|
||||
}
|
||||
|
||||
if (Application::the().focus_debugging_enabled()) {
|
||||
if (is_focused()) {
|
||||
Painter painter(*this);
|
||||
painter.draw_rect(rect(), Color::Cyan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Widget::set_layout(NonnullRefPtr<Layout> layout)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue