Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/PCSX2/pcsx2
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 20, 2024
2 parents 017941a + f1abee5 commit 3685330
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 60 deletions.
2 changes: 1 addition & 1 deletion pcsx2-qt/GameList/GameListWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void GameListWidget::onCoverScaleChanged()
m_list_view->setSpacing(m_model->getCoverArtSpacing());

QFont font;
font.setPointSizeF(16.0f * m_model->getCoverScale());
font.setPointSizeF(20.0f * m_model->getCoverScale());
m_list_view->setFont(font);
}

Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Settings/GraphicsSettingsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@
<number>100</number>
</property>
<property name="maximum">
<number>100000</number>
<number>200000</number>
</property>
<property name="singleStep">
<number>100</number>
Expand Down
4 changes: 3 additions & 1 deletion pcsx2-qt/Themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace QtHost
} // namespace QtHost

static QString s_unthemed_style_name;
static QPalette s_unthemed_palette;
static bool s_unthemed_style_name_set;

const char* QtHost::GetDefaultThemeName()
Expand All @@ -37,6 +38,7 @@ void QtHost::UpdateApplicationTheme()
{
s_unthemed_style_name_set = true;
s_unthemed_style_name = QApplication::style()->objectName();
s_unthemed_palette = QApplication::palette();
}

SetStyleFromSettings();
Expand All @@ -49,7 +51,7 @@ void QtHost::SetStyleFromSettings()

// setPalette() shouldn't be necessary, as the documentation claims that setStyle() resets the palette, but it
// is here, to work around a bug in 6.4.x and 6.5.x where the palette doesn't restore after changing themes.
qApp->setPalette(QPalette());
qApp->setPalette(QPalette(s_unthemed_palette));

if (theme == "fusion")
{
Expand Down
16 changes: 9 additions & 7 deletions pcsx2-qt/Translations/pcsx2-qt_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18308,37 +18308,39 @@ Scanning recursively takes more time, but will identify files in subdirectories.
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1114"/>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1144"/>
<source>usb-msd: Could not open image file &apos;{}&apos;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1179"/>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1182"/>
<source>Mass Storage Device</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1200"/>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1203"/>
<source>Modification time to USB mass storage image changed, reattaching.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1216"/>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1219"/>
<source>Iomega Zip-100 (Generic)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1217"/>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1220"/>
<source>Sony MSAC-US1 (PictureParadise)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1225"/>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1232"/>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1240"/>
<source>Image Path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1226"/>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1233"/>
<location filename="../../pcsx2/USB/usb-msd/usb-msd.cpp" line="1241"/>
<source>Sets the path to image which will back the virtual mass storage device.</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ struct Pcsx2Config
static constexpr int DEFAULT_VIDEO_CAPTURE_BITRATE = 6000;
static constexpr int DEFAULT_VIDEO_CAPTURE_WIDTH = 640;
static constexpr int DEFAULT_VIDEO_CAPTURE_HEIGHT = 480;
static constexpr int DEFAULT_AUDIO_CAPTURE_BITRATE = 160;
static constexpr int DEFAULT_AUDIO_CAPTURE_BITRATE = 192;
static const char* DEFAULT_CAPTURE_CONTAINER;

union
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/GS/GSBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ class GSBlock

// TODO: ReadAndExpandBlock4_16

// ReadAndExpandBlock8H for AVX2 platforms with slow VPGATHERDD (Haswell, Zen, Zen2, Zen3)
// ReadAndExpandBlock8H for AVX2 platforms with slow VPGATHERDD (Haswell, Zen, Zen2, Zen3, Zen4)
// Also serves as the implementation for AVX / SSE
__forceinline static void ReadAndExpandBlock8H_32HSW(const u8* RESTRICT src, u8* RESTRICT dst, int dstpitch, const u32* RESTRICT pal)
{
Expand Down
55 changes: 30 additions & 25 deletions pcsx2/ImGui/FullscreenUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ namespace
#define FSUI_FSTR(str) fmt::runtime(Host::TranslateToStringView(TR_CONTEXT, str))
#define FSUI_NSTR(str) str

using ImGuiFullscreen::FocusResetType;
using ImGuiFullscreen::g_large_font;
using ImGuiFullscreen::g_layout_padding_left;
using ImGuiFullscreen::g_layout_padding_top;
Expand Down Expand Up @@ -134,6 +135,7 @@ using ImGuiFullscreen::ForceKeyNavEnabled;
using ImGuiFullscreen::GetCachedTexture;
using ImGuiFullscreen::GetCachedTextureAsync;
using ImGuiFullscreen::GetPlaceholderTexture;
using ImGuiFullscreen::GetQueuedFocusResetType;
using ImGuiFullscreen::HorizontalMenuItem;
using ImGuiFullscreen::IsFocusResetQueued;
using ImGuiFullscreen::IsGamepadInputSource;
Expand Down Expand Up @@ -655,7 +657,7 @@ void FullscreenUI::OnVMStarted()
return;

s_current_main_window = MainWindowType::None;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
});
}

Expand Down Expand Up @@ -723,7 +725,7 @@ void FullscreenUI::OpenPauseMenu()
ForceKeyNavEnabled();
s_current_main_window = MainWindowType::PauseMenu;
s_current_pause_submenu = PauseSubMenu::None;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
});
}

Expand All @@ -738,14 +740,14 @@ void FullscreenUI::ClosePauseMenu()
s_current_main_window = MainWindowType::None;
s_current_pause_submenu = PauseSubMenu::None;
s_pause_menu_was_open = false;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

void FullscreenUI::OpenPauseSubMenu(PauseSubMenu submenu)
{
s_current_main_window = MainWindowType::PauseMenu;
s_current_pause_submenu = submenu;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

void FullscreenUI::Shutdown(bool clear_state)
Expand Down Expand Up @@ -901,7 +903,7 @@ void FullscreenUI::ReturnToPreviousWindow()
if (VMManager::HasValidVM() && s_pause_menu_was_open)
{
s_current_main_window = MainWindowType::PauseMenu;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}
else
{
Expand Down Expand Up @@ -976,7 +978,6 @@ void FullscreenUI::DoStartFile()
if (!path.empty())
DoStartPath(path);

QueueResetFocus();
CloseFileSelector();
};

Expand Down Expand Up @@ -1040,7 +1041,6 @@ void FullscreenUI::DoStartDisc()
FSUI_ICONSTR(ICON_FA_COMPACT_DISC, "Select Disc Drive"), false, std::move(options), [](s32, const std::string& path, bool) {
DoStartDisc(path);
CloseChoiceDialog();
QueueResetFocus();
});
}

Expand Down Expand Up @@ -1115,7 +1115,6 @@ void FullscreenUI::DoChangeDiscFromFile()
}
}

QueueResetFocus();
CloseFileSelector();
ReturnToPreviousWindow();
ClosePauseMenu();
Expand Down Expand Up @@ -1170,7 +1169,7 @@ void FullscreenUI::ConfirmShutdownIfMemcardBusy(std::function<void(bool)> callba
void FullscreenUI::SwitchToLanding()
{
s_current_main_window = MainWindowType::Landing;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

void FullscreenUI::DrawLandingTemplate(ImVec2* menu_pos, ImVec2* menu_size)
Expand Down Expand Up @@ -1267,7 +1266,7 @@ void FullscreenUI::DrawLandingWindow()
FSUI_CSTR("Launch a game from a file, disc, or starts the console without any disc inserted.")))
{
s_current_main_window = MainWindowType::StartGame;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

if (HorizontalMenuItem(GetCachedTexture("fullscreenui/applications-system.png"), FSUI_CSTR("Settings"),
Expand All @@ -1281,7 +1280,7 @@ void FullscreenUI::DrawLandingWindow()
(!AreAnyDialogsOpen() && WantsToCloseMenu()))
{
s_current_main_window = MainWindowType::Exit;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}
}
EndHorizontalMenu();
Expand Down Expand Up @@ -1349,7 +1348,7 @@ void FullscreenUI::DrawStartGameWindow()
(!AreAnyDialogsOpen() && WantsToCloseMenu()))
{
s_current_main_window = MainWindowType::Landing;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}
}
EndHorizontalMenu();
Expand Down Expand Up @@ -1395,7 +1394,7 @@ void FullscreenUI::DrawExitWindow()
WantsToCloseMenu())
{
s_current_main_window = MainWindowType::Landing;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

if (HorizontalMenuItem(GetCachedTexture("fullscreenui/exit.png"), FSUI_CSTR("Exit PCSX2"),
Expand Down Expand Up @@ -2701,7 +2700,7 @@ void FullscreenUI::SwitchToGameSettings(const std::string_view serial, u32 crc)
PopulatePatchesAndCheatsList(serial, crc);
s_current_main_window = MainWindowType::Settings;
s_settings_page = SettingsPage::Summary;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

void FullscreenUI::SwitchToGameSettings()
Expand Down Expand Up @@ -2844,15 +2843,15 @@ void FullscreenUI::DrawSettingsWindow()
{
index = (index == 0) ? (count - 1) : (index - 1);
s_settings_page = pages[index];
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}
else if (ImGui::IsKeyPressed(ImGuiKey_GamepadDpadRight, true) ||
ImGui::IsKeyPressed(ImGuiKey_NavGamepadTweakFast, true) ||
ImGui::IsKeyPressed(ImGuiKey_RightArrow, true))
{
index = (index + 1) % count;
s_settings_page = pages[index];
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}
}

Expand All @@ -2876,6 +2875,7 @@ void FullscreenUI::DrawSettingsWindow()
if (NavButton(icons[i], i == index, true, ITEM_WIDTH, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY))
{
s_settings_page = pages[i];
QueueResetFocus(FocusResetType::WindowChanged);
}
}

Expand All @@ -2886,7 +2886,12 @@ void FullscreenUI::DrawSettingsWindow()

// we have to do this here, because otherwise it uses target, and jumps a frame later.
if (IsFocusResetQueued())
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
if (FocusResetType focus_reset = GetQueuedFocusResetType(); focus_reset != FocusResetType::None &&
focus_reset != FocusResetType::PopupOpened &&
focus_reset != FocusResetType::PopupClosed)
{
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
}

if (BeginFullscreenWindow(
ImVec2(0.0f, heading_size.y),
Expand Down Expand Up @@ -3046,7 +3051,7 @@ void FullscreenUI::DrawSummarySettingsPage()
}
}

QueueResetFocus();
QueueResetFocus(FocusResetType::PopupClosed);
CloseFileSelector();
};

Expand Down Expand Up @@ -5517,7 +5522,7 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
{
s_save_state_selector_submenu_index = -1;
if (!closed)
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

ImGui::PopStyleColor(4);
Expand Down Expand Up @@ -5900,7 +5905,7 @@ void FullscreenUI::DrawGameListWindow()
else if (ImGui::IsKeyPressed(ImGuiKey_GamepadStart, false) || ImGui::IsKeyPressed(ImGuiKey_F2))
{
s_current_main_window = MainWindowType::GameListSettings;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

switch (s_game_list_view)
Expand Down Expand Up @@ -6318,7 +6323,7 @@ void FullscreenUI::DrawGameListSettingsWindow()
if (NavButton(ICON_PF_BACKWARD, true, true))
{
s_current_main_window = MainWindowType::GameList;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

NavTitle(FSUI_CSTR("Game List Settings"));
Expand All @@ -6339,7 +6344,7 @@ void FullscreenUI::DrawGameListSettingsWindow()
if (ImGui::IsWindowFocused() && WantsToCloseMenu())
{
s_current_main_window = MainWindowType::GameList;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

auto lock = Host::GetSettingsLock();
Expand Down Expand Up @@ -6495,7 +6500,7 @@ void FullscreenUI::SwitchToGameList()
auto lock = Host::GetSettingsLock();
PopulateGameListDirectoryCache(Host::Internal::GetBaseSettingsLayer());
}
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

GSTexture* FullscreenUI::GetGameListCover(const GameList::Entry* entry)
Expand Down Expand Up @@ -6665,7 +6670,7 @@ void FullscreenUI::SwitchToAchievementsWindow()
}

s_current_main_window = MainWindowType::Achievements;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

bool FullscreenUI::OpenLeaderboardsWindow()
Expand Down Expand Up @@ -6709,7 +6714,7 @@ void FullscreenUI::SwitchToLeaderboardsWindow()
}

s_current_main_window = MainWindowType::Leaderboards;
QueueResetFocus();
QueueResetFocus(FocusResetType::WindowChanged);
}

void FullscreenUI::DrawAchievementsSettingsPage(std::unique_lock<std::mutex>& settings_lock)
Expand Down
Loading

0 comments on commit 3685330

Please sign in to comment.