Qt: Fix per-game custom aspect ratio

This commit is contained in:
Connor McLaughlin 2022-12-21 13:35:12 +10:00
parent b530b08bc4
commit 5fa5957156
1 changed files with 12 additions and 4 deletions

View File

@ -289,14 +289,22 @@ void DisplaySettingsWidget::onGPUFullscreenModeIndexChanged()
void DisplaySettingsWidget::onIntegerFilteringChanged()
{
m_ui.displayLinearFiltering->setEnabled(!m_ui.displayIntegerScaling->isChecked());
m_ui.displayStretch->setEnabled(!m_ui.displayIntegerScaling->isChecked());
const bool integer_scaling = m_dialog->getEffectiveBoolValue("Display", "IntegerScaling", false);
m_ui.displayLinearFiltering->setEnabled(!integer_scaling);
m_ui.displayStretch->setEnabled(!integer_scaling);
}
void DisplaySettingsWidget::onAspectRatioChanged()
{
const bool is_custom =
static_cast<DisplayAspectRatio>(m_ui.displayAspectRatio->currentIndex()) == DisplayAspectRatio::Custom;
const DisplayAspectRatio ratio =
Settings::ParseDisplayAspectRatio(
m_dialog
->getEffectiveStringValue("Display", "AspectRatio",
Settings::GetDisplayAspectRatioName(Settings::DEFAULT_DISPLAY_ASPECT_RATIO))
.c_str())
.value_or(Settings::DEFAULT_DISPLAY_ASPECT_RATIO);
const bool is_custom = (ratio == DisplayAspectRatio::Custom);
m_ui.customAspectRatioNumerator->setVisible(is_custom);
m_ui.customAspectRatioDenominator->setVisible(is_custom);