From 927f398658b6c548fef2fc48d71f0179de3d196b Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Wed, 26 Feb 2025 06:51:02 -0600 Subject: [PATCH 1/2] core: Ensure logger is initialized when there is no param.sfo (#2542) * Make sure log is initialized when there is no param.sfo Helps with testing firmware elfs and probably some homebrew. * Clang * Clang --- src/emulator.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/emulator.cpp b/src/emulator.cpp index 68c1e332c..758720325 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -107,6 +107,11 @@ void Emulator::Run(const std::filesystem::path& file, const std::vectorGetHostPath("/app0/sce_sys/param.sfo"); + if (!std::filesystem::exists(param_sfo_path) || !Config::getSeparateLogFilesEnabled()) { + Common::Log::Initialize(); + Common::Log::Start(); + } + if (std::filesystem::exists(param_sfo_path)) { auto* param_sfo = Common::Singleton::Instance(); const bool success = param_sfo->Open(param_sfo_path); @@ -117,10 +122,8 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector Date: Wed, 26 Feb 2025 16:53:46 +0100 Subject: [PATCH 2/2] OLED Theme (#2530) * OLED Theme * improve check box & text box visibility * clang format --------- Co-authored-by: smiRaphi --- src/qt_gui/main_window.cpp | 14 ++++++++++++++ src/qt_gui/main_window_themes.cpp | 25 +++++++++++++++++++++++++ src/qt_gui/main_window_themes.h | 2 +- src/qt_gui/main_window_ui.h | 6 ++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index 96bd1d9e5..d9fb45fac 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -130,6 +130,7 @@ void MainWindow::CreateActions() { m_theme_act_group->addAction(ui->setThemeViolet); m_theme_act_group->addAction(ui->setThemeGruvbox); m_theme_act_group->addAction(ui->setThemeTokyoNight); + m_theme_act_group->addAction(ui->setThemeOled); } void MainWindow::AddUiWidgets() { @@ -651,6 +652,14 @@ void MainWindow::CreateConnects() { isIconBlack = false; } }); + connect(ui->setThemeOled, &QAction::triggered, &m_window_themes, [this]() { + m_window_themes.SetWindowTheme(Theme::Oled, ui->mw_searchbar); + Config::setMainWindowTheme(static_cast(Theme::Oled)); + if (isIconBlack) { + SetUiIcons(false); + isIconBlack = false; + } + }); } void MainWindow::StartGame() { @@ -1098,6 +1107,11 @@ void MainWindow::SetLastUsedTheme() { isIconBlack = false; SetUiIcons(false); break; + case Theme::Oled: + ui->setThemeOled->setChecked(true); + isIconBlack = false; + SetUiIcons(false); + break; } } diff --git a/src/qt_gui/main_window_themes.cpp b/src/qt_gui/main_window_themes.cpp index 5fffd4c9e..c5574fca9 100644 --- a/src/qt_gui/main_window_themes.cpp +++ b/src/qt_gui/main_window_themes.cpp @@ -6,6 +6,7 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { QPalette themePalette; + qApp->setStyleSheet(""); switch (theme) { case Theme::Dark: mw_searchbar->setStyleSheet( @@ -165,5 +166,29 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { themePalette.setColor(QPalette::HighlightedText, Qt::black); qApp->setPalette(themePalette); break; + case Theme::Oled: + mw_searchbar->setStyleSheet("QLineEdit:focus {" + "border: 1px solid #2A82DA; }"); + themePalette.setColor(QPalette::Window, Qt::black); + themePalette.setColor(QPalette::WindowText, Qt::white); + themePalette.setColor(QPalette::Base, Qt::black); + themePalette.setColor(QPalette::AlternateBase, Qt::black); + themePalette.setColor(QPalette::ToolTipBase, Qt::black); + themePalette.setColor(QPalette::ToolTipText, Qt::white); + themePalette.setColor(QPalette::Text, Qt::white); + themePalette.setColor(QPalette::Button, QColor(5, 5, 5)); + themePalette.setColor(QPalette::ButtonText, Qt::white); + themePalette.setColor(QPalette::BrightText, Qt::red); + themePalette.setColor(QPalette::Link, QColor(42, 130, 218)); + themePalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); + themePalette.setColor(QPalette::HighlightedText, Qt::black); + qApp->setPalette(themePalette); + qApp->setStyleSheet("QLineEdit {" + "background-color: #000000; color: #ffffff; border: 1px solid #a0a0a0; " + "border-radius: 4px; padding: 5px; }" + + "QCheckBox::indicator:unchecked {" + "border: 1px solid #808080; border-radius: 4px; }"); + break; } } \ No newline at end of file diff --git a/src/qt_gui/main_window_themes.h b/src/qt_gui/main_window_themes.h index 0ec2cce58..babde0f27 100644 --- a/src/qt_gui/main_window_themes.h +++ b/src/qt_gui/main_window_themes.h @@ -7,7 +7,7 @@ #include #include -enum class Theme : int { Dark, Light, Green, Blue, Violet, Gruvbox, TokyoNight }; +enum class Theme : int { Dark, Light, Green, Blue, Violet, Gruvbox, TokyoNight, Oled }; class WindowThemes : public QObject { Q_OBJECT diff --git a/src/qt_gui/main_window_ui.h b/src/qt_gui/main_window_ui.h index e74ffcacb..3ebfcee9e 100644 --- a/src/qt_gui/main_window_ui.h +++ b/src/qt_gui/main_window_ui.h @@ -39,6 +39,7 @@ public: QAction* setThemeViolet; QAction* setThemeGruvbox; QAction* setThemeTokyoNight; + QAction* setThemeOled; QWidget* centralWidget; QLineEdit* mw_searchbar; QPushButton* playButton; @@ -171,6 +172,9 @@ public: setThemeTokyoNight = new QAction(MainWindow); setThemeTokyoNight->setObjectName("setThemeTokyoNight"); setThemeTokyoNight->setCheckable(true); + setThemeOled = new QAction(MainWindow); + setThemeOled->setObjectName("setThemeOled"); + setThemeOled->setCheckable(true); centralWidget = new QWidget(MainWindow); centralWidget->setObjectName("centralWidget"); sizePolicy.setHeightForWidth(centralWidget->sizePolicy().hasHeightForWidth()); @@ -303,6 +307,7 @@ public: menuThemes->addAction(setThemeViolet); menuThemes->addAction(setThemeGruvbox); menuThemes->addAction(setThemeTokyoNight); + menuThemes->addAction(setThemeOled); menuGame_List_Icons->addAction(setIconSizeTinyAct); menuGame_List_Icons->addAction(setIconSizeSmallAct); menuGame_List_Icons->addAction(setIconSizeMediumAct); @@ -393,6 +398,7 @@ public: setThemeViolet->setText(QCoreApplication::translate("MainWindow", "Violet", nullptr)); setThemeGruvbox->setText("Gruvbox"); setThemeTokyoNight->setText("Tokyo Night"); + setThemeOled->setText("OLED"); toolBar->setWindowTitle(QCoreApplication::translate("MainWindow", "toolBar", nullptr)); } // retranslateUi };