mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 22:27:20 +02:00
Ignore right click on preview.
This commit is contained in:
parent
465fc42718
commit
d2e6003521
1 changed files with 13 additions and 10 deletions
|
@ -426,16 +426,19 @@ void Item::setupHistory() {
|
|||
|
||||
_scroll->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
|
||||
if (e->type() == QEvent::MouseButtonPress) {
|
||||
const auto relative = Ui::MapFrom(
|
||||
_inner.data(),
|
||||
_scroll.get(),
|
||||
static_cast<QMouseEvent*>(e.get())->pos());
|
||||
if (const auto view = _inner->lookupItemByY(relative.y())) {
|
||||
_actions.fire(ChatPreviewAction{
|
||||
.openItemId = view->data()->fullId(),
|
||||
});
|
||||
} else {
|
||||
_actions.fire(ChatPreviewAction{});
|
||||
const auto button = static_cast<QMouseEvent*>(e.get())->button();
|
||||
if (button == Qt::LeftButton) {
|
||||
const auto relative = Ui::MapFrom(
|
||||
_inner.data(),
|
||||
_scroll.get(),
|
||||
static_cast<QMouseEvent*>(e.get())->pos());
|
||||
if (const auto view = _inner->lookupItemByY(relative.y())) {
|
||||
_actions.fire(ChatPreviewAction{
|
||||
.openItemId = view->data()->fullId(),
|
||||
});
|
||||
} else {
|
||||
_actions.fire(ChatPreviewAction{});
|
||||
}
|
||||
}
|
||||
}
|
||||
}, lifetime());
|
||||
|
|
Loading…
Add table
Reference in a new issue