mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:57:35 +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
|
@ -35,6 +35,8 @@
|
|||
#include <LibWeb/Page/Frame.h>
|
||||
#include <LibWeb/PageView.h>
|
||||
|
||||
//#define DEBUG_HIGHLIGHT_FOCUSED_FRAME
|
||||
|
||||
namespace Web {
|
||||
|
||||
LayoutFrame::LayoutFrame(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
|
@ -82,6 +84,12 @@ void LayoutFrame::paint(PaintContext& context, PaintPhase phase)
|
|||
|
||||
context.set_viewport_rect(old_viewport_rect);
|
||||
context.painter().restore();
|
||||
|
||||
#ifdef DEBUG_HIGHLIGHT_FOCUSED_FRAME
|
||||
if (node().hosted_frame()->is_focused_frame()) {
|
||||
context.painter().draw_rect(absolute_rect().to<int>(), Color::Cyan);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue