From 5c303705acb68e587fde3dd4463091cb2195e7cd Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 16 Feb 2020 00:14:08 +0900 Subject: [PATCH] Qt: Use scroll area for hotkey binding list --- src/duckstation-qt/hotkeysettingswidget.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/duckstation-qt/hotkeysettingswidget.cpp b/src/duckstation-qt/hotkeysettingswidget.cpp index 041841b73..9587f4cdc 100644 --- a/src/duckstation-qt/hotkeysettingswidget.cpp +++ b/src/duckstation-qt/hotkeysettingswidget.cpp @@ -8,6 +8,7 @@ #include #include #include +#include HotkeySettingsWidget::HotkeySettingsWidget(QtHostInterface* host_interface, QWidget* parent /* = nullptr */) : QWidget(parent), m_host_interface(host_interface) @@ -40,14 +41,19 @@ void HotkeySettingsWidget::createButtons() auto iter = m_categories.find(hi.category); if (iter == m_categories.end()) { - QWidget* container = new QWidget(m_tab_widget); + QScrollArea* scroll = new QScrollArea(m_tab_widget); + QWidget* container = new QWidget(scroll); QVBoxLayout* vlayout = new QVBoxLayout(container); QGridLayout* layout = new QGridLayout(); layout->setContentsMargins(0, 0, 0, 0); vlayout->addLayout(layout); vlayout->addStretch(1); iter = m_categories.insert(hi.category, Category{container, layout}); - m_tab_widget->addTab(container, hi.category); + scroll->setWidget(container); + scroll->setWidgetResizable(true); + scroll->setBackgroundRole(QPalette::Base); + scroll->setFrameShape(QFrame::NoFrame); + m_tab_widget->addTab(scroll, hi.category); } QWidget* container = iter->container;