diff options
author | german77 <juangerman-13@hotmail.com> | 2022-12-23 09:22:18 -0600 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2022-12-23 18:26:48 -0600 |
commit | c3a5522830df3354c0e2c6ba4705defd199473a4 (patch) | |
tree | 509a4933ded9a1e1e774ce8e748323a4164cf083 /src/yuzu/configuration/configure_input_player.cpp | |
parent | 1b11e0f0d3209603e67b26f3ef22f1d1a493bbdc (diff) |
yuzu: Automatically refresh device list
Diffstat (limited to 'src/yuzu/configuration/configure_input_player.cpp')
-rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index b1575b0d3..183cbe562 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp @@ -738,13 +738,10 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i connect(ui->comboDevices, qOverload<int>(&QComboBox::activated), this, &ConfigureInputPlayer::UpdateMappingWithDefaults); + ui->comboDevices->installEventFilter(this); ui->comboDevices->setCurrentIndex(-1); - ui->buttonRefreshDevices->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh"))); - connect(ui->buttonRefreshDevices, &QPushButton::clicked, - [this] { emit RefreshInputDevices(); }); - timeout_timer->setSingleShot(true); connect(timeout_timer.get(), &QTimer::timeout, [this] { SetPollingResult({}, true); }); @@ -1479,6 +1476,13 @@ void ConfigureInputPlayer::keyPressEvent(QKeyEvent* event) { } } +bool ConfigureInputPlayer::eventFilter(QObject* object, QEvent* event) { + if (object == ui->comboDevices && event->type() == QEvent::MouseButtonPress) { + RefreshInputDevices(); + } + return object->eventFilter(object, event); +} + void ConfigureInputPlayer::CreateProfile() { const auto profile_name = LimitableInputDialog::GetText(this, tr("New Profile"), tr("Enter a profile name:"), 1, 30, |