Skip to content

Commit f122230

Browse files
committed
Qt: Fix typo and place them in same line + remove Time: and Date: notation
Currently typo fixed and instead of Time and Date being on seperate lines and then speedline, use a pipe for divider for same line. Also got rid of Time: and Date: being displayed it is kinda redudant.
1 parent 2a966ec commit f122230

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed

pcsx2-qt/Settings/GraphicsSettingsWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
806806
tr("Shows the current system time in the top-right corner of the display currently with Hour:Minute:Second (HH:MM:SS) format."));
807807

808808
dialog->registerWidgetHelp(m_ui.osdShowSystemDate, tr("Show System Date"), tr("Unchecked"),
809-
tr("Shows the current system date in the top-right corner of the display currerntly with Year-Month-Day (YYYY-MM-DD) format."));
809+
tr("Shows the current system date in the top-right corner of the display currently with Year-Month-Day (YYYY-MM-DD) format."));
810810

811811
// dialog->registerWidgetHelp(m_ui.osdShowUTCOffset, tr("Show UTC Offset"), tr("Unchecked"),
812812
// tr("Shows the current UTC/GMT offset in the top-right corner of the display."));

pcsx2/ImGui/FullscreenUI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3641,7 +3641,7 @@ void FullscreenUI::DrawInterfaceSettingsPage()
36413641
FSUI_CSTR("Shows the current system date on the OSD currently with Year-Month-Day (YYYY-MM-DD) format.."), "EmuCore/GS", "OsdShowSystemDate", false);
36423642
// DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_CLOCK, "Show UTC Offset"),
36433643
// FSUI_CSTR("Shows the UTC offset on the OSD."), "EmuCore/GS", "OsdShowUTCOffset", false);
3644-
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_EXCLAMATION, "Warn About Unsafe Settings"),
3644+
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_TRIANGLE_EXCLAMATION, "Warn About Unsafe Settings"),
36453645
FSUI_CSTR("Displays warnings when settings are enabled which may break games."), "EmuCore", "WarnAboutUnsafeSettings", true);
36463646

36473647
MenuHeading(FSUI_CSTR("Operations"));

pcsx2/ImGui/ImGuiOverlays.cpp

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
1+
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
22
// SPDX-License-Identifier: GPL-3.0+
33

44
#include "BuildVersion.h"
@@ -46,6 +46,9 @@
4646
#include <span>
4747
#include <tuple>
4848
#include <unordered_map>
49+
#include <iomanip>
50+
#include <sstream>
51+
#include <ctime>
4952

5053
std::string GetSystemDate()
5154
{
@@ -148,33 +151,45 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
148151
{
149152
bool first = true;
150153
// --- Display System Time and Date First + Second Line in Imgui or most top-right by default ---
151-
if (GSConfig.OsdShowSystemTime)
154+
if (GSConfig.OsdShowSystemTime || GSConfig.OsdShowSystemDate)
152155
{
153-
std::string systemTimeStr = GetSystemTime();
156+
text.clear(); // Clear for this new line
154157

155-
// Extract hours, minutes, and seconds from the host time string to prepare easier visuals such as HH:MM:SS
156-
std::string systemhours = systemTimeStr.substr(0, 2);
157-
std::string systemminutes = systemTimeStr.substr(3, 2);
158-
std::string systemseconds = systemTimeStr.substr(6, 2);
158+
if (GSConfig.OsdShowSystemTime)
159+
{
160+
std::string systemTimeStr = GetSystemTime();
159161

160-
text.clear(); // Clear for this new line
161-
text.append_format("Time: {}:{}:{} (HH:MM:SS)", systemhours, systemminutes, systemseconds); // Example: Time: 04H:48M:30S combination possible or just 04:48:30 as well or combined with what format it is with that and say HH:MM:SS but perhaps best in tooltip instead.
162-
if (!text.empty() && !systemTimeStr.empty()) // Ensure GetSystemTime returns the string
163-
DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255)); // Default White color
164-
}
162+
// Extract hours, minutes, and seconds from the host time string to prepare easier visuals such as HH:MM:SS
163+
std::string systemhours = systemTimeStr.substr(0, 2);
164+
std::string systemminutes = systemTimeStr.substr(3, 2);
165+
std::string systemseconds = systemTimeStr.substr(6, 2);
165166

166-
if (GSConfig.OsdShowSystemDate)
167-
{
168-
std::string systemDateStr = GetSystemDate();
167+
// Append formatted time using text.append_format (no icon used here)
168+
// TODO ICON_FA_CLOCK
169+
text.append_format("{}:{}:{}", systemhours.c_str(), systemminutes.c_str(), systemseconds.c_str()); // Currently: 04:48:30 other examples: 04:48:30 or Time: 04H:48M:30S combination possible or just 04:48:30 as well or combined with what format it is with that and say HH:MM:SS but perhaps best in tooltip instead.
170+
first = false; // After the first item is added, set 'first' to false to handle pipe separator correctly.
171+
}
169172

170-
// Extract year, month, and day from the date string to prepare easier visuals such as YYYY-MM-DD
171-
std::string year = systemDateStr.substr(0, 4);
172-
std::string month = systemDateStr.substr(5, 2);
173-
std::string day = systemDateStr.substr(8, 2);
173+
if (GSConfig.OsdShowSystemDate)
174+
{
175+
std::string systemDateStr = GetSystemDate();
174176

175-
text.clear(); // Clear for this new line
176-
text.append_format("Date: {}-{}-{} (YYYY-MM-DD)", year, month, day); // Example: Date: 2025 Y - 10 M - 05 D but can do 2025-10-05 as well or combined with what format it is or even look at the locale of user but perhaps best in tooltip instead.
177-
if (!text.empty() && !systemDateStr.empty()) // Ensure GetSystemDate returns the string
177+
// Extract year, month, and day from the date string to prepare easier visuals such as YYYY-MM-DD
178+
std::string year = systemDateStr.substr(0, 4);
179+
std::string month = systemDateStr.substr(5, 2);
180+
std::string day = systemDateStr.substr(8, 2);
181+
182+
// Append formatted date with pipe separator if not the first item
183+
if (!first) // If this is not the first item, add the pipe separator before appending the date
184+
text.append(" | "); // Add pipe separator if this isn't the first item
185+
186+
// Append formatted date using text.append_format (no icon used here)
187+
// TODO ICON_FA_CALENDAR
188+
text.append_format("{}-{}-{}", year.c_str(), month.c_str(), day.c_str()); // Currently: 📅 2025-10-05 other examples: 2025-10-05 or Date: 2025 Y - 10 M - 05 D but can do 2025-10-05 as well or combined with what format it is or even look at the locale of user but perhaps best in tooltip instead.
189+
}
190+
191+
// Only draw if there's any text to display
192+
if (!text.empty())
178193
DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255)); // Default White color
179194
}
180195

0 commit comments

Comments
 (0)