1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:57:45 +00:00

LibVT: Show terminal hyperlink targets as tooltips

This lets you see the target of a hyperlink before deciding to drag or
double click it.
This commit is contained in:
Andreas Kling 2021-01-03 17:24:02 +01:00
parent 347e5aa7b5
commit 7e0226dd02

View file

@ -825,6 +825,8 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event)
m_hovered_href_id = {};
m_hovered_href = {};
}
set_tooltip(m_hovered_href);
show_or_hide_tooltip();
if (!m_hovered_href.is_empty())
set_override_cursor(Gfx::StandardCursor::Arrow);
else
@ -877,6 +879,8 @@ void TerminalWidget::leave_event(Core::Event&)
bool should_update = !m_hovered_href.is_empty();
m_hovered_href = {};
m_hovered_href_id = {};
set_tooltip(m_hovered_href);
set_override_cursor(Gfx::StandardCursor::IBeam);
if (should_update)
update();
}