mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 04:07:35 +00:00
LibHTML: Detect link clicks
Clicking on a link in an HtmlView will now call on_link_click(String) if present, allowing you to implement basic hypertext navigation. :^)
This commit is contained in:
parent
b477aff843
commit
92aae72025
2 changed files with 28 additions and 0 deletions
|
@ -12,12 +12,15 @@ public:
|
|||
const Document* document() const { return m_document; }
|
||||
void set_document(Document*);
|
||||
|
||||
Function<void(const String&)> on_link_click;
|
||||
|
||||
protected:
|
||||
HtmlView(GWidget* parent = nullptr);
|
||||
|
||||
virtual void resize_event(GResizeEvent&) override;
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void mousemove_event(GMouseEvent&) override;
|
||||
virtual void mousedown_event(GMouseEvent&) override;
|
||||
|
||||
private:
|
||||
void layout_and_sync_size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue