mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user