diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-02-15 03:47:58 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-02-15 03:48:23 +0100 |
commit | 70f4a89d10cf6cbb538d64342e74743c79a9f593 (patch) | |
tree | 443131de4e7d86536175bb93cfcdf35137ac9120 | |
parent | Lower general settings margins, if the window is narrow (diff) | |
download | nheko-70f4a89d10cf6cbb538d64342e74743c79a9f593.tar.xz |
Quick hack to enable touch scrolling in settings and room list
-rw-r--r-- | src/RoomList.cpp | 3 | ||||
-rw-r--r-- | src/UserSettingsPage.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
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 <QObject> #include <QPainter> +#include <QScroller> #include <QTimer> #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 <QPushButton> #include <QResizeEvent> #include <QScrollArea> +#include <QScroller> #include <QSettings> #include <QStandardPaths> #include <QString> @@ -398,6 +399,8 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> 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_); |