Merge pull request #7037 from spycrab/qt_adapter_tooltip

Qt/GeneralWidget: Show tooltip when adapters are not supported by the backend
This commit is contained in:
spycrab 2018-05-31 03:56:41 +02:00 committed by GitHub
commit 5f48c9fc01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -338,8 +338,15 @@ void GeneralWidget::OnBackendChanged(const QString& backend_name)
for (const auto& adapter : adapters)
m_adapter_combo->addItem(QString::fromStdString(adapter));
const bool supports_adapters = !adapters.empty();
m_adapter_combo->setCurrentIndex(g_Config.iAdapter);
m_adapter_combo->setEnabled(!adapters.empty());
m_adapter_combo->setEnabled(supports_adapters);
m_adapter_combo->setToolTip(
supports_adapters ? QStringLiteral("") :
tr("%1 doesn't support this feature.")
.arg(QString::fromStdString(g_video_backend->GetDisplayName())));
m_adapter_combo->blockSignals(old);
}