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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user