Qt: Add label with pixel size of high-res upscale

This commit is contained in:
Vicki Pfau 2019-06-30 11:01:14 -07:00
parent 2420fd81e7
commit 4ea82f9e3a
2 changed files with 56 additions and 12 deletions

View File

@ -569,7 +569,6 @@ void SettingsView::reloadConfig() {
loadSetting("logFile", m_ui.logFile);
loadSetting("useDiscordPresence", m_ui.useDiscordPresence);
loadSetting("gba.audioHle", m_ui.audioHle);
loadSetting("videoScale", m_ui.videoScale, 1);
m_ui.libraryStyle->setCurrentIndex(loadSetting("libraryStyle").toInt());
@ -636,6 +635,11 @@ void SettingsView::reloadConfig() {
int hwaccelVideo = m_controller->getOption("hwaccelVideo", 0).toInt();
m_ui.hwaccelVideo->setCurrentIndex(hwaccelVideo);
connect(m_ui.videoScale, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this](int value) {
m_ui.videoScaleSize->setText(tr("(%1×%2)").arg(GBA_VIDEO_HORIZONTAL_PIXELS * value).arg(GBA_VIDEO_VERTICAL_PIXELS * value));
});
loadSetting("videoScale", m_ui.videoScale, 1);
}
void SettingsView::saveSetting(const char* key, const QAbstractButton* field) {

View File

@ -907,17 +907,57 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="videoScale">
<property name="suffix">
<string>×</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>16</number>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<item>
<widget class="QSpinBox" name="videoScale">
<property name="suffix">
<string>×</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>16</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="videoScaleSize">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>{size}</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>