diff options
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 12 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.h | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.ui | 19 |
3 files changed, 11 insertions, 23 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 | |||
| 738 | 738 | ||
| 739 | connect(ui->comboDevices, qOverload<int>(&QComboBox::activated), this, | 739 | connect(ui->comboDevices, qOverload<int>(&QComboBox::activated), this, |
| 740 | &ConfigureInputPlayer::UpdateMappingWithDefaults); | 740 | &ConfigureInputPlayer::UpdateMappingWithDefaults); |
| 741 | ui->comboDevices->installEventFilter(this); | ||
| 741 | 742 | ||
| 742 | ui->comboDevices->setCurrentIndex(-1); | 743 | ui->comboDevices->setCurrentIndex(-1); |
| 743 | 744 | ||
| 744 | ui->buttonRefreshDevices->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh"))); | ||
| 745 | connect(ui->buttonRefreshDevices, &QPushButton::clicked, | ||
| 746 | [this] { emit RefreshInputDevices(); }); | ||
| 747 | |||
| 748 | timeout_timer->setSingleShot(true); | 745 | timeout_timer->setSingleShot(true); |
| 749 | connect(timeout_timer.get(), &QTimer::timeout, [this] { SetPollingResult({}, true); }); | 746 | connect(timeout_timer.get(), &QTimer::timeout, [this] { SetPollingResult({}, true); }); |
| 750 | 747 | ||
| @@ -1479,6 +1476,13 @@ void ConfigureInputPlayer::keyPressEvent(QKeyEvent* event) { | |||
| 1479 | } | 1476 | } |
| 1480 | } | 1477 | } |
| 1481 | 1478 | ||
| 1479 | bool ConfigureInputPlayer::eventFilter(QObject* object, QEvent* event) { | ||
| 1480 | if (object == ui->comboDevices && event->type() == QEvent::MouseButtonPress) { | ||
| 1481 | RefreshInputDevices(); | ||
| 1482 | } | ||
| 1483 | return object->eventFilter(object, event); | ||
| 1484 | } | ||
| 1485 | |||
| 1482 | void ConfigureInputPlayer::CreateProfile() { | 1486 | void ConfigureInputPlayer::CreateProfile() { |
| 1483 | const auto profile_name = | 1487 | const auto profile_name = |
| 1484 | LimitableInputDialog::GetText(this, tr("New Profile"), tr("Enter a profile name:"), 1, 30, | 1488 | LimitableInputDialog::GetText(this, tr("New Profile"), tr("Enter a profile name:"), 1, 30, |
diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h index 26f60d121..6d1876f2b 100644 --- a/src/yuzu/configuration/configure_input_player.h +++ b/src/yuzu/configuration/configure_input_player.h | |||
| @@ -119,6 +119,9 @@ private: | |||
| 119 | /// Handle key press events. | 119 | /// Handle key press events. |
| 120 | void keyPressEvent(QKeyEvent* event) override; | 120 | void keyPressEvent(QKeyEvent* event) override; |
| 121 | 121 | ||
| 122 | /// Handle combobox list refresh | ||
| 123 | bool eventFilter(QObject* object, QEvent* event) override; | ||
| 124 | |||
| 122 | /// Update UI to reflect current configuration. | 125 | /// Update UI to reflect current configuration. |
| 123 | void UpdateUI(); | 126 | void UpdateUI(); |
| 124 | 127 | ||
diff --git a/src/yuzu/configuration/configure_input_player.ui b/src/yuzu/configuration/configure_input_player.ui index a62b57501..a9567c6ee 100644 --- a/src/yuzu/configuration/configure_input_player.ui +++ b/src/yuzu/configuration/configure_input_player.ui | |||
| @@ -122,25 +122,6 @@ | |||
| 122 | </property> | 122 | </property> |
| 123 | </widget> | 123 | </widget> |
| 124 | </item> | 124 | </item> |
| 125 | <item> | ||
| 126 | <widget class="QPushButton" name="buttonRefreshDevices"> | ||
| 127 | <property name="minimumSize"> | ||
| 128 | <size> | ||
| 129 | <width>21</width> | ||
| 130 | <height>21</height> | ||
| 131 | </size> | ||
| 132 | </property> | ||
| 133 | <property name="maximumSize"> | ||
| 134 | <size> | ||
| 135 | <width>21</width> | ||
| 136 | <height>21</height> | ||
| 137 | </size> | ||
| 138 | </property> | ||
| 139 | <property name="styleSheet"> | ||
| 140 | <string notr="true"/> | ||
| 141 | </property> | ||
| 142 | </widget> | ||
| 143 | </item> | ||
| 144 | </layout> | 125 | </layout> |
| 145 | </widget> | 126 | </widget> |
| 146 | </item> | 127 | </item> |