From 70f4a89d10cf6cbb538d64342e74743c79a9f593 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 15 Feb 2020 03:47:58 +0100 Subject: [PATCH] Quick hack to enable touch scrolling in settings and room list --- src/RoomList.cpp | 3 +++ src/UserSettingsPage.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/RoomList.cpp b/src/RoomList.cpp index a80e0757..6feb4f76 100644 --- a/src/RoomList.cpp +++ b/src/RoomList.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include "Logging.h" @@ -41,6 +42,8 @@ RoomList::RoomList(QWidget *parent) scrollArea_->setWidgetResizable(true); scrollArea_->setAlignment(Qt::AlignLeading | Qt::AlignTop | Qt::AlignVCenter); + QScroller::grabGesture(scrollArea_, QScroller::TouchGesture); + // The scrollbar on macOS will hide itself when not active so it won't interfere // with the content. #if not defined(Q_OS_MAC) diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp index da8f2f56..87d802b8 100644 --- a/src/UserSettingsPage.cpp +++ b/src/UserSettingsPage.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -398,6 +399,8 @@ UserSettingsPage::UserSettingsPage(QSharedPointer settings, QWidge scrollArea_->setWidgetResizable(true); scrollArea_->setAlignment(Qt::AlignTop | Qt::AlignVCenter); + QScroller::grabGesture(scrollArea_, QScroller::TouchGesture); + auto scrollAreaContents_ = new QWidget(this); scrollAreaContents_->setObjectName("UserSettingScrollWidget"); scrollAreaContents_->setLayout(mainLayout_);