From 496dbfb2f0d5f288b829f02848497a2b7cc85ebc Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 24 Oct 2025 19:58:37 +0400 Subject: [PATCH] Track mouse in pinned strip. --- .../calls/group/calls_group_messages_ui.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Telegram/SourceFiles/calls/group/calls_group_messages_ui.cpp b/Telegram/SourceFiles/calls/group/calls_group_messages_ui.cpp index a3966a4b4b..0c97cb905a 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_messages_ui.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_messages_ui.cpp @@ -1258,6 +1258,34 @@ void MessagesUi::setupPinnedWidget() { QRect(QPoint(), scroll->size() * ratio)); }, _pinned->lifetime()); + _pinned->setMouseTracking(true); + const auto find = [=](QPoint position) { + if (position.y() < 0 || position.y() >= _pinned->height()) { + return MsgId(); + } else for (const auto &entry : _pinnedViews) { + if (entry.left > position.x()) { + break; + } else if (entry.left + entry.width > position.x()) { + return entry.id; + } + } + return MsgId(); + }; + _pinned->events() | rpl::start_with_next([=](not_null e) { + const auto type = e->type(); + if (type == QEvent::MouseButtonPress) { + const auto pos = static_cast(e.get())->pos(); + if (const auto id = find(pos)) { + + } + } else if (type == QEvent::MouseMove) { + const auto pos = static_cast(e.get())->pos(); + _pinned->setCursor(find(pos) + ? style::cur_pointer + : style::cur_default); + } + }, _pinned->lifetime()); + scroll->show(); applyGeometry(); }