mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:08:12 +00:00
LibWeb: Add "focused frame" concept, one focused Frame per Page
Focus currently only moves when doing a mousedown in a frame.
This commit is contained in:
parent
d1d9545875
commit
6b4a7d1ee3
7 changed files with 35 additions and 0 deletions
|
@ -40,6 +40,18 @@ Page::~Page()
|
|||
{
|
||||
}
|
||||
|
||||
Frame& Page::focused_frame()
|
||||
{
|
||||
if (m_focused_frame)
|
||||
return *m_focused_frame;
|
||||
return main_frame();
|
||||
}
|
||||
|
||||
void Page::set_focused_frame(Badge<EventHandler>, Frame& frame)
|
||||
{
|
||||
m_focused_frame = frame.make_weak_ptr();
|
||||
}
|
||||
|
||||
void Page::load(const URL& url)
|
||||
{
|
||||
main_frame().loader().load(url, FrameLoader::Type::Navigation);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue