mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 09:45:07 +00:00
LibVT: Show the hover hand cursor when hovering over hyperlinks :^)
This commit is contained in:
parent
7b34f5bb92
commit
31ec4de0ee
2 changed files with 15 additions and 0 deletions
|
@ -644,6 +644,10 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event)
|
||||||
if (attribute.href_id != m_hovered_href_id) {
|
if (attribute.href_id != m_hovered_href_id) {
|
||||||
m_hovered_href_id = attribute.href_id;
|
m_hovered_href_id = attribute.href_id;
|
||||||
m_hovered_href = attribute.href;
|
m_hovered_href = attribute.href;
|
||||||
|
if (!m_hovered_href.is_empty())
|
||||||
|
window()->set_override_cursor(GUI::StandardCursor::Hand);
|
||||||
|
else
|
||||||
|
window()->set_override_cursor(GUI::StandardCursor::None);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -656,6 +660,16 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event)
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TerminalWidget::leave_event(Core::Event&)
|
||||||
|
{
|
||||||
|
window()->set_override_cursor(GUI::StandardCursor::None);
|
||||||
|
bool should_update = !m_hovered_href.is_empty();
|
||||||
|
m_hovered_href = {};
|
||||||
|
m_hovered_href_id = {};
|
||||||
|
if (should_update)
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
void TerminalWidget::mousewheel_event(GUI::MouseEvent& event)
|
void TerminalWidget::mousewheel_event(GUI::MouseEvent& event)
|
||||||
{
|
{
|
||||||
if (!is_scrollable())
|
if (!is_scrollable())
|
||||||
|
|
|
@ -101,6 +101,7 @@ private:
|
||||||
virtual void focusout_event(Core::Event&) override;
|
virtual void focusout_event(Core::Event&) override;
|
||||||
virtual void context_menu_event(GUI::ContextMenuEvent&) override;
|
virtual void context_menu_event(GUI::ContextMenuEvent&) override;
|
||||||
virtual void drop_event(GUI::DropEvent&) override;
|
virtual void drop_event(GUI::DropEvent&) override;
|
||||||
|
virtual void leave_event(Core::Event&) override;
|
||||||
virtual void did_change_font() override;
|
virtual void did_change_font() override;
|
||||||
|
|
||||||
// ^TerminalClient
|
// ^TerminalClient
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue