all repos — mgba @ cda0f95464f1e2a7c9f1202b87c476bfb07ed6e1

mGBA Game Boy Advance Emulator

Qt: Add option to disable FPS display
Vicki Pfau vi@endrift.com
Thu, 26 Oct 2017 20:04:33 -0700
commit

cda0f95464f1e2a7c9f1202b87c476bfb07ed6e1

parent

6d93a3d12bf6a93960c6932f7eca0ad44b9b1bde

M CHANGESCHANGES

@@ -33,6 +33,7 @@ - Python: Integrate tests from cinema test suite

- Util: Don't build crc32 if the function already exists - GBA: Implement display start DMAs - Qt: Prevent window from being created off-screen + - Qt: Add option to disable FPS display 0.6.1: (2017-10-01) Bugfixes:
M src/platform/qt/SettingsView.cppsrc/platform/qt/SettingsView.cpp

@@ -337,6 +337,7 @@ saveSetting("patchPath", m_ui.patchPath);

saveSetting("libraryStyle", m_ui.libraryStyle->currentIndex()); saveSetting("showLibrary", m_ui.showLibrary); saveSetting("preload", m_ui.preload); + saveSetting("showFps", m_ui.showFps); if (m_ui.fastForwardUnbounded->isChecked()) { saveSetting("fastForwardRatio", "-1");

@@ -454,6 +455,7 @@ loadSetting("screenshotPath", m_ui.screenshotPath);

loadSetting("patchPath", m_ui.patchPath); loadSetting("showLibrary", m_ui.showLibrary); loadSetting("preload", m_ui.preload); + loadSetting("showFps", m_ui.showFps, true); m_ui.libraryStyle->setCurrentIndex(loadSetting("libraryStyle").toInt());
M src/platform/qt/SettingsView.uisrc/platform/qt/SettingsView.ui

@@ -495,6 +495,16 @@ <enum>Qt::Horizontal</enum>

</property> </widget> </item> + <item row="9" column="1"> + <widget class="QCheckBox" name="showFps"> + <property name="text"> + <string>Show FPS in title bar</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> </layout> </widget> <widget class="QWidget" name="emulation">
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -677,7 +677,9 @@ }

#endif m_hitUnimplementedBiosCall = false; - m_fpsTimer.start(); + if (m_config->getOption("showFps", "1").toInt()) { + m_fpsTimer.start(); + } m_focusCheck.start(); if (m_display->underMouse()) { m_screenWidget->setCursor(Qt::BlankCursor);

@@ -1584,6 +1586,16 @@ preload->connect([this](const QVariant& value) {

m_manager->setPreload(value.toBool()); }, this); m_config->updateOption("preload"); + + ConfigOption* showFps = m_config->addOption("showFps"); + showFps->connect([this](const QVariant& value) { + if (!value.toInt()) { + m_fpsTimer.stop(); + updateTitle(); + } else if (m_controller) { + m_fpsTimer.start(); + } + }, this); QAction* exitFullScreen = new QAction(tr("Exit fullscreen"), frameMenu); connect(exitFullScreen, &QAction::triggered, this, &Window::exitFullScreen);