Settings: Make OSD message durations customizable

This commit is contained in:
Stenzek
2025-11-24 19:23:44 +10:00
parent 1cc5fe081c
commit e02883eabd
9 changed files with 239 additions and 27 deletions

View File

@@ -2203,9 +2203,10 @@ void FullscreenUI::DrawInterfaceSettingsPage()
FSUI_VSTR("Determines the margin between the edge of the screen and on-screen messages."),
"Display", "OSDMargin", ImGuiManager::DEFAULT_SCREEN_MARGIN, 0.0f, 100.0f, 1.0f, 1.0f,
"%.0fpx");
DrawToggleSetting(bsi, FSUI_ICONVSTR(ICON_FA_CIRCLE_EXCLAMATION, "Show OSD Messages"),
FSUI_VSTR("Shows on-screen-display messages when events occur."), "Display", "ShowOSDMessages",
true);
DrawToggleSetting(bsi, FSUI_ICONVSTR(ICON_FA_CIRCLE_EXCLAMATION, "Show Messages"),
FSUI_VSTR("Shows on-screen-display messages when events occur. Errors and warnings are still "
"displayed regardless of this setting."),
"Display", "ShowOSDMessages", true);
DrawToggleSetting(bsi, FSUI_ICONVSTR(ICON_FA_PLAY, "Show Status Indicators"),
FSUI_VSTR("Shows persistent icons when turbo is active or when paused."), "Display",
"ShowStatusIndicators", true);
@@ -2248,6 +2249,32 @@ void FullscreenUI::DrawInterfaceSettingsPage()
FSUI_VSTR("Shows enhancement settings in the bottom-right corner of the screen."), "Display",
"ShowEnhancements", false);
MenuHeading(FSUI_VSTR("On-Screen Display Message Durations"));
static constexpr float MIN_OSD_MESSAGE_DURATION = 0.5f;
static constexpr float MAX_OSD_MESSAGE_DURATION = 60.0f;
static constexpr float OSD_MESSAGE_DURATION_STEP = 0.5f;
DrawFloatSpinBoxSetting(
bsi, FSUI_ICONSTR(ICON_FA_TRIANGLE_EXCLAMATION, "Error Message Duration"),
FSUI_VSTR("Determines how long error messages are displayed on screen."), "Display", "OSDErrorDuration",
Settings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS[static_cast<size_t>(OSDMessageType::Error)],
MIN_OSD_MESSAGE_DURATION, MAX_OSD_MESSAGE_DURATION, OSD_MESSAGE_DURATION_STEP, 1.0f, FSUI_CSTR("%g seconds"));
DrawFloatSpinBoxSetting(
bsi, FSUI_ICONSTR(ICON_FA_CIRCLE_EXCLAMATION, "Warning Message Duration"),
FSUI_VSTR("Determines how long warning messages are displayed on screen."), "Display", "OSDWarningDuration",
Settings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS[static_cast<size_t>(OSDMessageType::Warning)],
MIN_OSD_MESSAGE_DURATION, MAX_OSD_MESSAGE_DURATION, OSD_MESSAGE_DURATION_STEP, 1.0f, FSUI_CSTR("%g seconds"));
DrawFloatSpinBoxSetting(
bsi, FSUI_ICONSTR(ICON_FA_CIRCLE_INFO, "Informational Message Duration"),
FSUI_VSTR("Determines how long informational messages are displayed on screen."), "Display", "OSDInfoDuration",
Settings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS[static_cast<size_t>(OSDMessageType::Info)],
MIN_OSD_MESSAGE_DURATION, MAX_OSD_MESSAGE_DURATION, OSD_MESSAGE_DURATION_STEP, 1.0f, FSUI_CSTR("%g seconds"));
DrawFloatSpinBoxSetting(
bsi, FSUI_ICONSTR(ICON_FA_CIRCLE_CHECK, "Quick Message Duration"),
FSUI_VSTR("Determines how long action confirmation messages are displayed on screen."), "Display",
"OSDQuickDuration", Settings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS[static_cast<size_t>(OSDMessageType::Quick)],
MIN_OSD_MESSAGE_DURATION, MAX_OSD_MESSAGE_DURATION, OSD_MESSAGE_DURATION_STEP, 1.0f, FSUI_CSTR("%g seconds"));
MenuHeading(FSUI_VSTR("Operations"));
{
if (MenuButton(FSUI_ICONVSTR(ICON_FA_DUMPSTER_FIRE, "Restore Defaults"),

View File

@@ -24,6 +24,7 @@ TRANSLATE_NOOP("FullscreenUI", "%d Frames");
TRANSLATE_NOOP("FullscreenUI", "%d cycles");
TRANSLATE_NOOP("FullscreenUI", "%d ms");
TRANSLATE_NOOP("FullscreenUI", "%d sectors");
TRANSLATE_NOOP("FullscreenUI", "%g seconds");
TRANSLATE_NOOP("FullscreenUI", "%u MB");
TRANSLATE_NOOP("FullscreenUI", "-");
TRANSLATE_NOOP("FullscreenUI", "1 Frame");
@@ -94,7 +95,6 @@ TRANSLATE_NOOP("FullscreenUI", "Achievement Notifications");
TRANSLATE_NOOP("FullscreenUI", "Achievement Unlock/Count");
TRANSLATE_NOOP("FullscreenUI", "Achievements");
TRANSLATE_NOOP("FullscreenUI", "Achievements Settings");
TRANSLATE_NOOP("FullscreenUI", "Achievements are not enabled.");
TRANSLATE_NOOP("FullscreenUI", "Achievements: ");
TRANSLATE_NOOP("FullscreenUI", "Activates runahead when analog input changes, which significantly increases system requirements.");
TRANSLATE_NOOP("FullscreenUI", "Add Search Directory");
@@ -235,6 +235,10 @@ TRANSLATE_NOOP("FullscreenUI", "Destination Alpha Blending");
TRANSLATE_NOOP("FullscreenUI", "Details");
TRANSLATE_NOOP("FullscreenUI", "Details unavailable for game not scanned in game list.");
TRANSLATE_NOOP("FullscreenUI", "Determines how large the on-screen messages and monitor are.");
TRANSLATE_NOOP("FullscreenUI", "Determines how long action confirmation messages are displayed on screen.");
TRANSLATE_NOOP("FullscreenUI", "Determines how long error messages are displayed on screen.");
TRANSLATE_NOOP("FullscreenUI", "Determines how long informational messages are displayed on screen.");
TRANSLATE_NOOP("FullscreenUI", "Determines how long warning messages are displayed on screen.");
TRANSLATE_NOOP("FullscreenUI", "Determines how much button pressure is ignored before activating the macro.");
TRANSLATE_NOOP("FullscreenUI", "Determines how much latency there is between the audio being picked up by the host API, and played through speakers.");
TRANSLATE_NOOP("FullscreenUI", "Determines how much of the area typically not visible on a consumer TV set to crop/hide.");
@@ -328,6 +332,7 @@ TRANSLATE_NOOP("FullscreenUI", "Ensures every frame generated is displayed for o
TRANSLATE_NOOP("FullscreenUI", "Enter Value");
TRANSLATE_NOOP("FullscreenUI", "Enter the name of the controller preset you wish to create.");
TRANSLATE_NOOP("FullscreenUI", "Error");
TRANSLATE_NOOP("FullscreenUI", "Error Message Duration");
TRANSLATE_NOOP("FullscreenUI", "Example: https://www.example-not-a-real-domain.com/covers/${serial}.jpg");
TRANSLATE_NOOP("FullscreenUI", "Execution Mode");
TRANSLATE_NOOP("FullscreenUI", "Exit");
@@ -410,6 +415,7 @@ TRANSLATE_NOOP("FullscreenUI", "Includes the elapsed time since the application
TRANSLATE_NOOP("FullscreenUI", "Includes the elapsed time since the application start in window and console logs.");
TRANSLATE_NOOP("FullscreenUI", "Increases the field of view from 4:3 to the chosen display aspect ratio in 3D games.");
TRANSLATE_NOOP("FullscreenUI", "Increases the precision of polygon culling, reducing the number of holes in geometry.");
TRANSLATE_NOOP("FullscreenUI", "Informational Message Duration");
TRANSLATE_NOOP("FullscreenUI", "Inhibit Screensaver");
TRANSLATE_NOOP("FullscreenUI", "Input Sources");
TRANSLATE_NOOP("FullscreenUI", "Interface Settings");
@@ -499,6 +505,7 @@ TRANSLATE_NOOP("FullscreenUI", "Not Scanning Subdirectories");
TRANSLATE_NOOP("FullscreenUI", "OK");
TRANSLATE_NOOP("FullscreenUI", "OSD Scale");
TRANSLATE_NOOP("FullscreenUI", "On-Screen Display");
TRANSLATE_NOOP("FullscreenUI", "On-Screen Display Message Durations");
TRANSLATE_NOOP("FullscreenUI", "Open Containing Directory");
TRANSLATE_NOOP("FullscreenUI", "Open To Game List");
TRANSLATE_NOOP("FullscreenUI", "Open in File Browser");
@@ -547,6 +554,7 @@ TRANSLATE_NOOP("FullscreenUI", "Progress Indicators");
TRANSLATE_NOOP("FullscreenUI", "Provides vibration and LED control support over Bluetooth.");
TRANSLATE_NOOP("FullscreenUI", "Purple Rain");
TRANSLATE_NOOP("FullscreenUI", "Push a controller button or axis now.");
TRANSLATE_NOOP("FullscreenUI", "Quick Message Duration");
TRANSLATE_NOOP("FullscreenUI", "Quick Save");
TRANSLATE_NOOP("FullscreenUI", "Read Speedup");
TRANSLATE_NOOP("FullscreenUI", "Readahead Sectors");
@@ -675,7 +683,7 @@ TRANSLATE_NOOP("FullscreenUI", "Show GPU Usage");
TRANSLATE_NOOP("FullscreenUI", "Show Grid View Titles");
TRANSLATE_NOOP("FullscreenUI", "Show Latency Statistics");
TRANSLATE_NOOP("FullscreenUI", "Show Localized Titles");
TRANSLATE_NOOP("FullscreenUI", "Show OSD Messages");
TRANSLATE_NOOP("FullscreenUI", "Show Messages");
TRANSLATE_NOOP("FullscreenUI", "Show Resolution");
TRANSLATE_NOOP("FullscreenUI", "Show Speed");
TRANSLATE_NOOP("FullscreenUI", "Show Status Indicators");
@@ -687,7 +695,7 @@ TRANSLATE_NOOP("FullscreenUI", "Shows a visual history of frame times in the upp
TRANSLATE_NOOP("FullscreenUI", "Shows enhancement settings in the bottom-right corner of the screen.");
TRANSLATE_NOOP("FullscreenUI", "Shows information about input and audio latency in the top-right corner of the display.");
TRANSLATE_NOOP("FullscreenUI", "Shows information about the emulated GPU in the top-right corner of the display.");
TRANSLATE_NOOP("FullscreenUI", "Shows on-screen-display messages when events occur.");
TRANSLATE_NOOP("FullscreenUI", "Shows on-screen-display messages when events occur. Errors and warnings are still displayed regardless of this setting.");
TRANSLATE_NOOP("FullscreenUI", "Shows persistent icons when turbo is active or when paused.");
TRANSLATE_NOOP("FullscreenUI", "Shows the current controller state of the system in the bottom-left corner of the display.");
TRANSLATE_NOOP("FullscreenUI", "Shows the current emulation speed of the system in the top-right corner of the display as a percentage.");
@@ -746,8 +754,6 @@ TRANSLATE_NOOP("FullscreenUI", "The SDL input source supports most controllers."
TRANSLATE_NOOP("FullscreenUI", "The audio backend determines how frames produced by the emulator are submitted to the host.");
TRANSLATE_NOOP("FullscreenUI", "The selected memory card image will be used in shared mode for this slot.");
TRANSLATE_NOOP("FullscreenUI", "Theme");
TRANSLATE_NOOP("FullscreenUI", "This game has no achievements.");
TRANSLATE_NOOP("FullscreenUI", "This game has no leaderboards.");
TRANSLATE_NOOP("FullscreenUI", "Threaded Rendering");
TRANSLATE_NOOP("FullscreenUI", "Time Played");
TRANSLATE_NOOP("FullscreenUI", "Time Played: ");
@@ -804,6 +810,7 @@ TRANSLATE_NOOP("FullscreenUI", "Vertical Sync (VSync)");
TRANSLATE_NOOP("FullscreenUI", "WARNING: Activating cheats can cause unpredictable behavior, crashing, soft-locks, or broken saved games.");
TRANSLATE_NOOP("FullscreenUI", "WARNING: Activating game patches can cause unpredictable behavior, crashing, soft-locks, or broken saved games.");
TRANSLATE_NOOP("FullscreenUI", "WARNING: Your game is still saving to the memory card. Continuing to {0} may IRREVERSIBLY DESTROY YOUR MEMORY CARD. We recommend resuming your game and waiting 5 seconds for it to finish saving.\n\nDo you want to {0} anyway?");
TRANSLATE_NOOP("FullscreenUI", "Warning Message Duration");
TRANSLATE_NOOP("FullscreenUI", "When Big Picture mode is started, the game list will be displayed instead of the main menu.");
TRANSLATE_NOOP("FullscreenUI", "When enabled and logged in, DuckStation will scan for achievements on startup.");
TRANSLATE_NOOP("FullscreenUI", "When enabled, DuckStation will assume all achievements are locked and not send any unlock notifications to the server.");

View File

@@ -115,6 +115,16 @@ void SettingInfo::CopyValue(SettingsInterface* dest_si, const SettingsInterface&
}
}
const std::array<float, 5> GPUSettings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS = {{
15.0f, // Error
10.0f, // Warning
5.0f, // Info
2.5f, // Quick
std::numeric_limits<float>::max(), // Persistent
}};
static_assert(static_cast<size_t>(OSDMessageType::MaxCount) ==
GPUSettings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS.size());
GPUSettings::GPUSettings()
{
SetPGXPDepthClearThreshold(DEFAULT_GPU_PGXP_DEPTH_THRESHOLD);
@@ -370,6 +380,14 @@ void Settings::Load(const SettingsInterface& si, const SettingsInterface& contro
display_osd_scale = si.GetFloatValue("Display", "OSDScale", DEFAULT_OSD_SCALE);
display_osd_margin = std::max(si.GetFloatValue("Display", "OSDMargin", ImGuiManager::DEFAULT_SCREEN_MARGIN), 0.0f);
for (size_t i = 0; i < static_cast<size_t>(OSDMessageType::Persistent); i++)
{
display_osd_message_duration[i] = si.GetFloatValue(
"Display", TinyString::from_format("OSD{}Duration", GetDisplayOSDMessageTypeName(static_cast<OSDMessageType>(i))),
DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS[i]);
}
display_osd_message_duration[static_cast<size_t>(OSDMessageType::Persistent)] = std::numeric_limits<float>::max();
save_state_compression = ParseSaveStateCompressionModeName(
si.GetStringValue("Main", "SaveStateCompression",
GetSaveStateCompressionModeName(DEFAULT_SAVE_STATE_COMPRESSION_MODE))
@@ -708,6 +726,14 @@ void Settings::Save(SettingsInterface& si, bool ignore_base) const
si.SetBoolValue("Display", "ShowEnhancements", display_show_enhancements);
si.SetFloatValue("Display", "OSDScale", display_osd_scale);
si.SetFloatValue("Display", "OSDMargin", display_osd_margin);
for (size_t i = 0; i < static_cast<size_t>(OSDMessageType::MaxCount); i++)
{
si.SetFloatValue(
"Display",
TinyString::from_format("OSD{}Duration", GetDisplayOSDMessageTypeName(static_cast<OSDMessageType>(i))),
display_osd_message_duration[i]);
}
}
si.SetBoolValue("Display", "AutoResizeWindow", display_auto_resize_window);
@@ -2243,6 +2269,16 @@ std::optional<DisplayScreenshotFormat> Settings::GetDisplayScreenshotFormatFromF
return std::nullopt;
}
static constexpr const std::array s_display_osd_message_type_names = {
"Error", "Warning", "Info", "Quick", "Persistent",
};
static_assert(s_display_osd_message_type_names.size() == static_cast<size_t>(OSDMessageType::MaxCount));
const char* Settings::GetDisplayOSDMessageTypeName(OSDMessageType type)
{
return s_display_osd_message_type_names[static_cast<size_t>(type)];
}
static constexpr const std::array s_achievement_challenge_indicator_mode_names = {
"Disabled",
"PersistentIcon",

View File

@@ -23,6 +23,7 @@ enum class Level : u32;
enum class RenderAPI : u8;
enum class MediaCaptureBackend : u8;
enum class OSDMessageType : u8;
struct GPUSettings
{
@@ -121,6 +122,8 @@ struct GPUSettings
float display_osd_scale = DEFAULT_OSD_SCALE;
float display_osd_margin = 0.0f;
std::array<float, 5> display_osd_message_duration = DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS;
// texture replacements
struct TextureReplacementSettings
{
@@ -226,6 +229,8 @@ struct GPUSettings
static constexpr float DEFAULT_DISPLAY_PRE_FRAME_SLEEP_BUFFER = 2.0f;
static constexpr float DEFAULT_OSD_SCALE = 100.0f;
static const std::array<float, 5> DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS;
#ifndef __ANDROID__
static constexpr u8 DEFAULT_GPU_MAX_QUEUED_FRAMES = 2;
static constexpr bool DEFAULT_GPU_PREFER_GLES_CONTEXT = false;
@@ -540,6 +545,8 @@ struct Settings : public GPUSettings
static const char* GetDisplayScreenshotFormatExtension(DisplayScreenshotFormat mode);
static std::optional<DisplayScreenshotFormat> GetDisplayScreenshotFormatFromFileName(const std::string_view filename);
static const char* GetDisplayOSDMessageTypeName(OSDMessageType type);
static std::optional<MemoryCardType> ParseMemoryCardTypeName(const char* str);
static const char* GetMemoryCardTypeName(MemoryCardType type);
static const char* GetMemoryCardTypeDisplayName(MemoryCardType type);

View File

@@ -4568,6 +4568,7 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode ||
g_settings.display_osd_scale != old_settings.display_osd_scale ||
g_settings.display_osd_margin != old_settings.display_osd_margin ||
g_settings.display_osd_message_duration != old_settings.display_osd_message_duration ||
g_settings.gpu_pgxp_enable != old_settings.gpu_pgxp_enable ||
g_settings.gpu_pgxp_texture_correction != old_settings.gpu_pgxp_texture_correction ||
g_settings.gpu_pgxp_color_correction != old_settings.gpu_pgxp_color_correction ||

View File

@@ -219,7 +219,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
SettingWidgetBinder::BindWidgetToFloatSetting(sif, m_ui.osdMargin, "Display", "OSDMargin",
ImGuiManager::DEFAULT_SCREEN_MARGIN);
SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.fullscreenUITheme, "UI", "FullscreenUITheme");
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.showOSDMessages, "Display", "ShowOSDMessages", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.showMessages, "Display", "ShowOSDMessages", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.showFPS, "Display", "ShowFPS", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.showSpeed, "Display", "ShowSpeed", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.showResolution, "Display", "ShowResolution", false);
@@ -233,8 +233,22 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.showFrameTimes, "Display", "ShowFrameTimes", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.showSettings, "Display", "ShowEnhancements", false);
SettingWidgetBinder::BindWidgetToFloatSetting(
sif, m_ui.osdErrorDuration, "Display", "OSDErrorDuration",
Settings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS[static_cast<size_t>(OSDMessageType::Error)]);
SettingWidgetBinder::BindWidgetToFloatSetting(
sif, m_ui.osdWarningDuration, "Display", "OSDWarningDuration",
Settings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS[static_cast<size_t>(OSDMessageType::Warning)]);
SettingWidgetBinder::BindWidgetToFloatSetting(
sif, m_ui.osdInformationDuration, "Display", "OSDInfoDuration",
Settings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS[static_cast<size_t>(OSDMessageType::Info)]);
SettingWidgetBinder::BindWidgetToFloatSetting(
sif, m_ui.osdQuickDuration, "Display", "OSDQuickDuration",
Settings::DEFAULT_DISPLAY_OSD_MESSAGE_DURATIONS[static_cast<size_t>(OSDMessageType::Quick)]);
connect(m_ui.fullscreenUITheme, QOverload<int>::of(&QComboBox::currentIndexChanged), g_emu_thread,
&EmuThread::updateFullscreenUITheme);
connect(m_ui.showMessages, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onOSDShowMessagesChanged);
// Capture Tab
@@ -363,6 +377,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
updateRendererDependentOptions();
onDownsampleModeChanged();
updateResolutionDependentOptions();
onOSDShowMessagesChanged();
onMediaCaptureBackendChanged();
onMediaCaptureAudioEnabledChanged();
onMediaCaptureVideoEnabledChanged();
@@ -549,9 +564,10 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
tr("Changes the size at which on-screen elements, including status and messages are displayed."));
dialog->registerWidgetHelp(m_ui.fullscreenUITheme, tr("Theme"), tr("Automatic"),
tr("Determines the theme to use for on-screen display elements and the Big Picture UI."));
dialog->registerWidgetHelp(m_ui.showOSDMessages, tr("Show OSD Messages"), tr("Checked"),
tr("Shows on-screen-display messages when events occur such as save states being "
"created/loaded, screenshots being taken, etc."));
dialog->registerWidgetHelp(
m_ui.showMessages, tr("Show Messages"), tr("Checked"),
tr("Shows on-screen-display messages when events occur such as save states being created/loaded, screenshots being "
"taken, etc. Errors and warnings are still displayed regardless of this setting."));
dialog->registerWidgetHelp(m_ui.showResolution, tr("Show Resolution"), tr("Unchecked"),
tr("Shows the resolution of the game in the top-right corner of the display."));
dialog->registerWidgetHelp(
@@ -1144,6 +1160,18 @@ void GraphicsSettingsWidget::onDownsampleModeChanged()
}
}
void GraphicsSettingsWidget::onOSDShowMessagesChanged()
{
const bool enabled = m_dialog->getEffectiveBoolValue("Display", "ShowOSDMessages", true);
// Errors/warnings are always shown.
m_ui.osdInformationDurationLabel->setEnabled(enabled);
m_ui.osdInformationDuration->setEnabled(enabled);
m_ui.osdQuickDurationLabel->setEnabled(enabled);
m_ui.osdQuickDuration->setEnabled(enabled);
}
void GraphicsSettingsWidget::onMediaCaptureBackendChanged()
{
SettingsInterface* const sif = m_dialog->getSettingsInterface();

View File

@@ -49,6 +49,8 @@ private:
void updateResolutionDependentOptions();
void onDownsampleModeChanged();
void onOSDShowMessagesChanged();
void onMediaCaptureBackendChanged();
void onMediaCaptureContainerChanged();
void onMediaCaptureVideoEnabledChanged();

View File

@@ -652,14 +652,14 @@
<property name="title">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_14" columnstretch="0,1">
<layout class="QGridLayout" name="gridLayout_14" columnstretch="0,1" columnminimumwidth="100,0">
<property name="topMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>OSD Scale:</string>
<string>Display Scale:</string>
</property>
</widget>
</item>
@@ -679,7 +679,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Screen Margins:</string>
<string>Display Margins:</string>
</property>
</widget>
</item>
@@ -706,9 +706,9 @@
<item row="3" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QCheckBox" name="showOSDMessages">
<widget class="QCheckBox" name="showMessages">
<property name="text">
<string>Show OSD Messages</string>
<string>Show Messages</string>
</property>
</widget>
</item>
@@ -794,6 +794,119 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="osdMessageDurations">
<property name="title">
<string>Message Durations</string>
</property>
<layout class="QGridLayout" name="gridLayout_21" columnstretch="0,1,0,1" columnminimumwidth="100,0,100,0">
<item row="0" column="0">
<widget class="QLabel" name="osdErrorDurationLabel">
<property name="text">
<string>Error:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="osdErrorDuration">
<property name="suffix">
<string> seconds</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.500000000000000</double>
</property>
<property name="maximum">
<double>60.000000000000000</double>
</property>
<property name="singleStep">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="osdWarningDurationLabel">
<property name="text">
<string>Warning:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QDoubleSpinBox" name="osdWarningDuration">
<property name="suffix">
<string> seconds</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.500000000000000</double>
</property>
<property name="maximum">
<double>60.000000000000000</double>
</property>
<property name="singleStep">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="osdInformationDurationLabel">
<property name="text">
<string>Informational:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="osdInformationDuration">
<property name="suffix">
<string> seconds</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.500000000000000</double>
</property>
<property name="maximum">
<double>60.000000000000000</double>
</property>
<property name="singleStep">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="osdQuickDurationLabel">
<property name="text">
<string>Quick:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QDoubleSpinBox" name="osdQuickDuration">
<property name="suffix">
<string> seconds</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.500000000000000</double>
</property>
<property name="maximum">
<double>60.000000000000000</double>
</property>
<property name="singleStep">
<double>0.500000000000000</double>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">

View File

@@ -828,16 +828,7 @@ void ImGuiManager::ReloadFontDataIfActive()
float ImGuiManager::GetOSDMessageDuration(OSDMessageType type)
{
DebugAssert(type < OSDMessageType::MaxCount);
static constexpr const std::array<float, static_cast<size_t>(OSDMessageType::MaxCount)> durations = {{
15.0f, // Error
10.0f, // Warning
5.0f, // Info
2.5f, // Quick
std::numeric_limits<float>::max(), // Persistent
}};
return durations[static_cast<size_t>(type)];
return g_gpu_settings.display_osd_message_duration[static_cast<size_t>(type)];
}
void ImGuiManager::AddOSDMessage(OSDMessageType type, std::string key, std::string icon, std::string title,