mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibWeb: Paint the focus outline using Painter::draw_focus_rect()
Now it actually looks like a classic focus outline and not some misplaced border :^)
This commit is contained in:
parent
642491fc74
commit
9bc7912f84
1 changed files with 2 additions and 2 deletions
|
@ -156,7 +156,7 @@ void PaintableBox::paint(PaintContext& context, PaintPhase phase) const
|
|||
if (phase == PaintPhase::FocusOutline && layout_box().dom_node() && layout_box().dom_node()->is_element() && verify_cast<DOM::Element>(*layout_box().dom_node()).is_focused()) {
|
||||
// FIXME: Implement this as `outline` using :focus-visible in the default UA stylesheet to make it possible to override/disable.
|
||||
auto focus_outline_rect = enclosing_int_rect(absolute_border_box_rect()).inflated(4, 4);
|
||||
context.painter().draw_rect(focus_outline_rect, context.palette().focus_outline());
|
||||
context.painter().draw_focus_rect(focus_outline_rect, context.palette().focus_outline());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -468,7 +468,7 @@ void PaintableWithLines::paint(PaintContext& context, PaintPhase phase) const
|
|||
if (parent->is_focused()) {
|
||||
// FIXME: Implement this as `outline` using :focus-visible in the default UA stylesheet to make it possible to override/disable.
|
||||
auto focus_outline_rect = enclosing_int_rect(fragment.absolute_rect()).inflated(4, 4);
|
||||
context.painter().draw_rect(focus_outline_rect, context.palette().focus_outline());
|
||||
context.painter().draw_focus_rect(focus_outline_rect, context.palette().focus_outline());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue