Ignore right click on preview.

This commit is contained in:
John Preston 2024-05-29 10:12:56 +04:00
parent 465fc42718
commit d2e6003521
1 changed files with 13 additions and 10 deletions

View File

@ -426,16 +426,19 @@ void Item::setupHistory() {
_scroll->events() | rpl::start_with_next([=](not_null<QEvent*> e) { _scroll->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
if (e->type() == QEvent::MouseButtonPress) { if (e->type() == QEvent::MouseButtonPress) {
const auto relative = Ui::MapFrom( const auto button = static_cast<QMouseEvent*>(e.get())->button();
_inner.data(), if (button == Qt::LeftButton) {
_scroll.get(), const auto relative = Ui::MapFrom(
static_cast<QMouseEvent*>(e.get())->pos()); _inner.data(),
if (const auto view = _inner->lookupItemByY(relative.y())) { _scroll.get(),
_actions.fire(ChatPreviewAction{ static_cast<QMouseEvent*>(e.get())->pos());
.openItemId = view->data()->fullId(), if (const auto view = _inner->lookupItemByY(relative.y())) {
}); _actions.fire(ChatPreviewAction{
} else { .openItemId = view->data()->fullId(),
_actions.fire(ChatPreviewAction{}); });
} else {
_actions.fire(ChatPreviewAction{});
}
} }
} }
}, lifetime()); }, lifetime());