2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Support chat preview on touchscreens.

This commit is contained in:
John Preston
2024-05-30 22:33:24 +04:00
parent 40fbd415ef
commit 4df5372dab
5 changed files with 67 additions and 1 deletions

View File

@@ -473,6 +473,7 @@ Widget::Widget(
updateSearchFromVisibility(true);
setupSupportMode();
setupScrollUpButton();
setupTouchChatPreview();
const auto overscrollBg = [=] {
return anim::color(
@@ -655,6 +656,18 @@ void Widget::setupScrollUpButton() {
updateScrollUpVisibility();
}
void Widget::setupTouchChatPreview() {
_scroll->setCustomTouchProcess([=](not_null<QTouchEvent*> e) {
_inner->processTouchEvent(e);
return false;
});
_inner->touchCancelRequests() | rpl::start_with_next([=] {
QTouchEvent ev(QEvent::TouchCancel);
ev.setTimestamp(crl::now());
QGuiApplication::sendEvent(_scroll, &ev);
}, _inner->lifetime());
}
void Widget::setupMoreChatsBar() {
if (_layout == Layout::Child) {
return;