all repos — mgba @ 4ea82f9e3ae326a1070162e8ab34f9e685cf1fc6

mGBA Game Boy Advance Emulator

Qt: Add label with pixel size of high-res upscale
Vicki Pfau vi@endrift.com
Sun, 30 Jun 2019 11:01:14 -0700
commit

4ea82f9e3ae326a1070162e8ab34f9e685cf1fc6

parent

2420fd81e71c3db111fa44cfc075b1c921948b24

2 files changed, 56 insertions(+), 12 deletions(-)

jump to
M src/platform/qt/SettingsView.cppsrc/platform/qt/SettingsView.cpp

@@ -569,7 +569,6 @@ loadSetting("logToStdout", m_ui.logToStdout);

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 @@ #endif

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) {
M src/platform/qt/SettingsView.uisrc/platform/qt/SettingsView.ui

@@ -907,17 +907,57 @@ </property>

</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>