mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-30 09:35:40 +00:00
Qt: Use scroll area for hotkey binding list
This commit is contained in:
parent
1ce1e016ae
commit
5c303705ac
|
@ -8,6 +8,7 @@
|
||||||
#include <QtGui/QKeyEvent>
|
#include <QtGui/QKeyEvent>
|
||||||
#include <QtWidgets/QGridLayout>
|
#include <QtWidgets/QGridLayout>
|
||||||
#include <QtWidgets/QLabel>
|
#include <QtWidgets/QLabel>
|
||||||
|
#include <QtWidgets/QScrollArea>
|
||||||
|
|
||||||
HotkeySettingsWidget::HotkeySettingsWidget(QtHostInterface* host_interface, QWidget* parent /* = nullptr */)
|
HotkeySettingsWidget::HotkeySettingsWidget(QtHostInterface* host_interface, QWidget* parent /* = nullptr */)
|
||||||
: QWidget(parent), m_host_interface(host_interface)
|
: QWidget(parent), m_host_interface(host_interface)
|
||||||
|
@ -40,14 +41,19 @@ void HotkeySettingsWidget::createButtons()
|
||||||
auto iter = m_categories.find(hi.category);
|
auto iter = m_categories.find(hi.category);
|
||||||
if (iter == m_categories.end())
|
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);
|
QVBoxLayout* vlayout = new QVBoxLayout(container);
|
||||||
QGridLayout* layout = new QGridLayout();
|
QGridLayout* layout = new QGridLayout();
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
vlayout->addLayout(layout);
|
vlayout->addLayout(layout);
|
||||||
vlayout->addStretch(1);
|
vlayout->addStretch(1);
|
||||||
iter = m_categories.insert(hi.category, Category{container, layout});
|
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;
|
QWidget* container = iter->container;
|
||||||
|
|
Loading…
Reference in a new issue