Qt/GeneralWidget: Show tooltip when adapters are not supported by the backend

This commit is contained in:
spycrab 2018-05-31 03:52:18 +02:00
parent 9337aa4eea
commit 8e5a96fcfc
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) for (const auto& adapter : adapters)
m_adapter_combo->addItem(QString::fromStdString(adapter)); m_adapter_combo->addItem(QString::fromStdString(adapter));
const bool supports_adapters = !adapters.empty();
m_adapter_combo->setCurrentIndex(g_Config.iAdapter); 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); m_adapter_combo->blockSignals(old);
} }