summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-03-26 00:53:31 +0000
committerLinus Groh <mail@linusgroh.de>2022-03-26 01:35:39 +0000
commit9bc7912f8485bde997c032bd7c08c74c409a3c15 (patch)
tree083afa4b929a352541fe93216a75fc1f7b642157 /Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
parent642491fc74c90ea11be4bef385a328f82ecd8efa (diff)
downloadserenity-9bc7912f8485bde997c032bd7c08c74c409a3c15.zip
LibWeb: Paint the focus outline using Painter::draw_focus_rect()
Now it actually looks like a classic focus outline and not some misplaced border :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting/PaintableBox.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Painting/PaintableBox.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
index e8e085aa25..5d13f85c57 100644
--- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
+++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
@@ -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());
}
}
}