mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibVT: Show the hover hand cursor when hovering over hyperlinks :^)
This commit is contained in:
@@ -644,6 +644,10 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event)
|
||||
if (attribute.href_id != m_hovered_href_id) {
|
||||
m_hovered_href_id = attribute.href_id;
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -656,6 +660,16 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event)
|
||||
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)
|
||||
{
|
||||
if (!is_scrollable())
|
||||
|
||||
Reference in New Issue
Block a user