mirror of
https://github.com/microsoft/terminal.git
synced 2026-07-08 18:16:28 +00:00
Refresh hovered hyperlink on scroll
This commit is contained in:
@@ -247,6 +247,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
[weakThis = get_weak()](const auto& update) {
|
||||
if (auto core{ weakThis.get() }; core && !core->_IsClosing())
|
||||
{
|
||||
// GH#20219: re-evaluate if we're hovering over a hyperlink after scrolling
|
||||
core->_refreshHoveredCell();
|
||||
core->ScrollPositionChanged.raise(*core, update);
|
||||
}
|
||||
});
|
||||
@@ -749,6 +751,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_terminal->UserScrollViewport(viewTop);
|
||||
}
|
||||
|
||||
// GH#20219: re-evaluate if we're hovering over a hyperlink after scrolling
|
||||
_refreshHoveredCell();
|
||||
|
||||
const auto shared = _shared.lock_shared();
|
||||
if (shared->outputIdle)
|
||||
{
|
||||
@@ -835,11 +840,22 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
_updateHoveredCell(std::optional<til::point>{ pos });
|
||||
}
|
||||
|
||||
void ControlCore::ClearHoveredCell()
|
||||
{
|
||||
_updateHoveredCell(std::nullopt);
|
||||
}
|
||||
|
||||
void ControlCore::_refreshHoveredCell()
|
||||
{
|
||||
if (_lastHoveredCell)
|
||||
{
|
||||
const auto cell = *_lastHoveredCell;
|
||||
_lastHoveredCell.reset();
|
||||
_updateHoveredCell(cell);
|
||||
}
|
||||
}
|
||||
|
||||
void ControlCore::_updateHoveredCell(const std::optional<til::point> terminalPosition)
|
||||
{
|
||||
if (terminalPosition == _lastHoveredCell)
|
||||
|
||||
@@ -353,6 +353,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
void _connectionOutputHandler(winrt::array_view<const char16_t> str);
|
||||
void _connectionStateChangedHandler(const TerminalConnection::ITerminalConnection&, const Windows::Foundation::IInspectable&);
|
||||
void _updateHoveredCell(const std::optional<til::point> terminalPosition);
|
||||
void _refreshHoveredCell();
|
||||
void _setOpacity(const float opacity, const bool focused = true);
|
||||
|
||||
bool _isBackgroundTransparent();
|
||||
|
||||
Reference in New Issue
Block a user