mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
Ladybird/WebContentView: Accept focus and notify WebContent on change
This commit is contained in:
parent
71dadabfaa
commit
c154d94964
2 changed files with 14 additions and 0 deletions
|
@ -58,6 +58,8 @@ WebContentView::WebContentView()
|
|||
{
|
||||
setMouseTracking(true);
|
||||
|
||||
setFocusPolicy(Qt::FocusPolicy::StrongFocus);
|
||||
|
||||
m_inverse_pixel_scaling_ratio = 1.0 / devicePixelRatio();
|
||||
|
||||
verticalScrollBar()->setSingleStep(24);
|
||||
|
@ -354,6 +356,16 @@ void WebContentView::keyReleaseEvent(QKeyEvent* event)
|
|||
client().async_key_up(keycode, modifiers, point);
|
||||
}
|
||||
|
||||
void WebContentView::focusInEvent(QFocusEvent*)
|
||||
{
|
||||
client().async_set_has_focus(true);
|
||||
}
|
||||
|
||||
void WebContentView::focusOutEvent(QFocusEvent*)
|
||||
{
|
||||
client().async_set_has_focus(false);
|
||||
}
|
||||
|
||||
Gfx::IntPoint WebContentView::to_content(Gfx::IntPoint viewport_position) const
|
||||
{
|
||||
return viewport_position.translated(horizontalScrollBar()->value(), verticalScrollBar()->value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue