Minor Qt GUI update (#363)

* Minor Qt GUI update

* Update gui_context_menus.h

* Update gui_context_menus.h

* Update game_info.cpp
This commit is contained in:
Xphalnos 2024-08-04 15:07:10 +02:00 committed by GitHub
parent 6d0a763145
commit 21462523de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 63 additions and 48 deletions

View file

@ -29,8 +29,10 @@ jobs:
uses: jurplel/install-qt-action@v4
with:
version: 6.7.2
host: windows
target: desktop
arch: win64_msvc2019_64
archives: qtsvg qtbase
archives: qtbase
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.

View file

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <QHeaderView>
#include "elf_viewer.h"
ElfViewer::ElfViewer(QWidget* parent) : QTableWidget(parent) {

View file

@ -14,6 +14,7 @@
#include <QTreeView>
#include <QVBoxLayout>
#include <QWidget>
#include "core/loader/elf.h"
#include "game_list_frame.h"

View file

@ -14,6 +14,7 @@
#include <QVBoxLayout>
#include <QWidget>
#include <QtConcurrent/QtConcurrent>
#include "common/config.h"
#include "game_info.h"
#include "game_list_utils.h"

View file

@ -5,6 +5,7 @@
#include <thread>
#include <QProgressDialog>
#include <QtConcurrent/QtConcurrent>
#include "game_info.h"
GameInfoClass::GameInfoClass() = default;
@ -42,4 +43,4 @@ void GameInfoClass::GetGameInfo(QWidget* parent) {
&QProgressDialog::setValue);
dialog.exec();
}
}

View file

@ -7,6 +7,7 @@
#include <QObject>
#include <QPixmap>
#include <QtConcurrent/QtConcurrent>
#include "common/config.h"
#include "core/file_format/psf.h"
#include "game_list_utils.h"

View file

@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "game_install_dialog.h"
#include <QDialogButtonBox>
#include <QDir>
#include <QFileDialog>
@ -14,6 +12,8 @@
#include <QPushButton>
#include <QVBoxLayout>
#include "game_install_dialog.h"
GameInstallDialog::GameInstallDialog() : m_gamesDirectory(nullptr) {
auto layout = new QVBoxLayout(this);
@ -21,8 +21,8 @@ GameInstallDialog::GameInstallDialog() : m_gamesDirectory(nullptr) {
layout->addStretch();
layout->addWidget(SetupDialogActions());
setWindowTitle("Shadps4 - Choose directory");
setWindowIcon(QIcon(":/images/shadps4.ico"));
setWindowTitle("shadPS4 - Choose directory");
setWindowIcon(QIcon(":images/shadps4.ico"));
}
GameInstallDialog::~GameInstallDialog() {}
@ -47,7 +47,7 @@ QWidget* GameInstallDialog::SetupGamesDirectory() {
layout->addWidget(m_gamesDirectory);
// Browse button.
auto browse = new QPushButton("...");
auto browse = new QPushButton("Browse");
connect(browse, &QPushButton::clicked, this, &GameInstallDialog::Browse);

View file

@ -4,6 +4,7 @@
#pragma once
#include <QDialog>
#include "common/config.h"
#include "common/path_util.h"

View file

@ -190,17 +190,17 @@ void GameListFrame::SetRegionFlag(int row, int column, QString itemStr) {
QTableWidgetItem* item = new QTableWidgetItem();
QImage scaledPixmap;
if (itemStr == "Japan") {
scaledPixmap = QImage(":/images/flag_jp.png");
scaledPixmap = QImage(":images/flag_jp.png");
} else if (itemStr == "Europe") {
scaledPixmap = QImage(":/images/flag_eu.png");
scaledPixmap = QImage(":images/flag_eu.png");
} else if (itemStr == "USA") {
scaledPixmap = QImage(":/images/flag_us.png");
scaledPixmap = QImage(":images/flag_us.png");
} else if (itemStr == "Asia") {
scaledPixmap = QImage(":/images/flag_china.png");
scaledPixmap = QImage(":images/flag_china.png");
} else if (itemStr == "World") {
scaledPixmap = QImage(":/images/flag_world.png");
scaledPixmap = QImage(":images/flag_world.png");
} else {
scaledPixmap = QImage(":/images/flag_unk.png");
scaledPixmap = QImage(":images/flag_unk.png");
}
QWidget* widget = new QWidget(this);
QVBoxLayout* layout = new QVBoxLayout(widget);

View file

@ -16,6 +16,7 @@
#include <QVBoxLayout>
#include <QWidget>
#include <QtConcurrent/QtConcurrent>
#include "game_info.h"
#include "game_list_utils.h"
#include "gui_context_menus.h"

View file

@ -165,12 +165,12 @@ public:
if (createShortcutLinux(linkPath, ebootPath, iconPath)) {
#endif
QMessageBox::information(
nullptr, "Shortcut Creation",
QString("Shortcut created successfully:\n %1").arg(linkPath));
nullptr, "Shortcut creation",
QString("Shortcut created successfully!\n %1").arg(linkPath));
} else {
QMessageBox::critical(
nullptr, "Error",
QString("Error creating shortcut:\n %1").arg(linkPath));
QString("Error creating shortcut!\n %1").arg(linkPath));
}
} else {
QMessageBox::critical(nullptr, "Error", "Failed to convert icon.");
@ -183,11 +183,11 @@ public:
if (createShortcutLinux(linkPath, ebootPath, iconPath)) {
#endif
QMessageBox::information(
nullptr, "Shortcut Creation",
QString("Shortcut created successfully:\n %1").arg(linkPath));
nullptr, "Shortcut creation",
QString("Shortcut created successfully!\n %1").arg(linkPath));
} else {
QMessageBox::critical(nullptr, "Error",
QString("Error creating shortcut:\n %1").arg(linkPath));
QString("Error creating shortcut!\n %1").arg(linkPath));
}
}
}
@ -308,7 +308,7 @@ private:
QFile shortcutFile(linkPath);
if (!shortcutFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
QMessageBox::critical(nullptr, "Error",
QString("Error creating shortcut:\n %1").arg(linkPath));
QString("Error creating shortcut!\n %1").arg(linkPath));
return false;
}

View file

@ -8,6 +8,7 @@
#include <QProgressDialog>
#include <QStatusBar>
#include <QtConcurrent>
#include "common/io_file.h"
#include "common/version.h"
#include "core/file_format/pkg.h"

View file

@ -10,6 +10,7 @@
#include <QMimeData>
#include <QScopedPointer>
#include <fmt/core.h>
#include "common/config.h"
#include "common/path_util.h"
#include "core/file_format/psf.h"

View file

@ -7,25 +7,6 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) {
QPalette themePalette;
switch (theme) {
case Theme::Light:
mw_searchbar->setStyleSheet("background-color: #ffffff; /* Light gray background */"
"color: #000000; /* Black text */"
"padding: 5px;");
themePalette.setColor(QPalette::Window, QColor(240, 240, 240)); // Light gray
themePalette.setColor(QPalette::WindowText, Qt::black); // Black
themePalette.setColor(QPalette::Base, QColor(230, 230, 230, 80)); // Grayish
themePalette.setColor(QPalette::ToolTipBase, Qt::black); // Black
themePalette.setColor(QPalette::ToolTipText, Qt::black); // Black
themePalette.setColor(QPalette::Text, Qt::black); // Black
themePalette.setColor(QPalette::Button, QColor(240, 240, 240)); // Light gray
themePalette.setColor(QPalette::ButtonText, Qt::black); // Black
themePalette.setColor(QPalette::BrightText, Qt::red); // Red
themePalette.setColor(QPalette::Link, QColor(42, 130, 218)); // Blue
themePalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); // Blue
themePalette.setColor(QPalette::HighlightedText, Qt::white); // White
qApp->setPalette(themePalette);
break;
case Theme::Dark:
mw_searchbar->setStyleSheet("background-color: #1e1e1e; /* Dark background */"
"color: #ffffff; /* White text */"
@ -48,6 +29,25 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) {
qApp->setPalette(themePalette);
break;
case Theme::Light:
mw_searchbar->setStyleSheet("background-color: #ffffff; /* Light gray background */"
"color: #000000; /* Black text */"
"padding: 5px;");
themePalette.setColor(QPalette::Window, QColor(240, 240, 240)); // Light gray
themePalette.setColor(QPalette::WindowText, Qt::black); // Black
themePalette.setColor(QPalette::Base, QColor(230, 230, 230, 80)); // Grayish
themePalette.setColor(QPalette::ToolTipBase, Qt::black); // Black
themePalette.setColor(QPalette::ToolTipText, Qt::black); // Black
themePalette.setColor(QPalette::Text, Qt::black); // Black
themePalette.setColor(QPalette::Button, QColor(240, 240, 240)); // Light gray
themePalette.setColor(QPalette::ButtonText, Qt::black); // Black
themePalette.setColor(QPalette::BrightText, Qt::red); // Red
themePalette.setColor(QPalette::Link, QColor(42, 130, 218)); // Blue
themePalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); // Blue
themePalette.setColor(QPalette::HighlightedText, Qt::white); // White
qApp->setPalette(themePalette);
break;
case Theme::Green:
mw_searchbar->setStyleSheet("background-color: #354535; /* Dark green background */"
"color: #ffffff; /* White text */"

View file

@ -2,13 +2,14 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QApplication>
#include <QLineEdit>
#include <QWidget>
enum class Theme : int {
Light,
Dark,
Light,
Green,
Blue,
Violet,

View file

@ -44,8 +44,8 @@ public:
QAction* gameInstallPathAct;
QAction* dumpGameListAct;
QAction* pkgViewerAct;
QAction* setThemeLight;
QAction* setThemeDark;
QAction* setThemeLight;
QAction* setThemeGreen;
QAction* setThemeBlue;
QAction* setThemeViolet;
@ -76,7 +76,7 @@ public:
MainWindow->setObjectName("MainWindow");
// MainWindow->resize(1280, 720);
QIcon icon;
icon.addFile(QString::fromUtf8(":/images/shadps4.ico"), QSize(), QIcon::Normal, QIcon::Off);
icon.addFile(QString::fromUtf8(":images/shadps4.ico"), QSize(), QIcon::Normal, QIcon::Off);
MainWindow->setWindowIcon(icon);
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
@ -136,13 +136,13 @@ public:
pkgViewerAct->setObjectName("pkgViewer");
pkgViewerAct->setObjectName("pkgViewer");
pkgViewerAct->setIcon(QIcon(":images/file_icon.png"));
setThemeLight = new QAction(MainWindow);
setThemeLight->setObjectName("setThemeLight");
setThemeLight->setCheckable(true);
setThemeLight->setChecked(true);
setThemeDark = new QAction(MainWindow);
setThemeDark->setObjectName("setThemeDark");
setThemeDark->setCheckable(true);
setThemeDark->setChecked(true);
setThemeLight = new QAction(MainWindow);
setThemeLight->setObjectName("setThemeLight");
setThemeLight->setCheckable(true);
setThemeGreen = new QAction(MainWindow);
setThemeGreen->setObjectName("setThemeGreen");
setThemeGreen->setCheckable(true);
@ -285,7 +285,7 @@ public:
} // setupUi
void retranslateUi(QMainWindow* MainWindow) {
MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "Shadps4", nullptr));
MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "shadPS4", nullptr));
addElfFolderAct->setText(
QCoreApplication::translate("MainWindow", "Open/Add Elf Folder", nullptr));
bootInstallPkgAct->setText(
@ -332,8 +332,8 @@ public:
menuSettings->setTitle(QCoreApplication::translate("MainWindow", "Settings", nullptr));
menuUtils->setTitle(QCoreApplication::translate("MainWindow", "Utils", nullptr));
menuThemes->setTitle(QCoreApplication::translate("MainWindow", "Themes", nullptr));
setThemeLight->setText(QCoreApplication::translate("MainWindow", "Light", nullptr));
setThemeDark->setText(QCoreApplication::translate("MainWindow", "Dark", nullptr));
setThemeLight->setText(QCoreApplication::translate("MainWindow", "Light", nullptr));
setThemeGreen->setText(QCoreApplication::translate("MainWindow", "Green", nullptr));
setThemeBlue->setText(QCoreApplication::translate("MainWindow", "Blue", nullptr));
setThemeViolet->setText(QCoreApplication::translate("MainWindow", "Violet", nullptr));

View file

@ -3,6 +3,7 @@
#include <QHeaderView>
#include <QWidget>
#include "pkg_viewer.h"
PKGViewer::PKGViewer(std::shared_ptr<GameInfoClass> game_info_get, QWidget* parent,

View file

@ -15,6 +15,7 @@
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QtConcurrent/QtConcurrent>
#include "common/io_file.h"
#include "core/file_format/pkg.h"
#include "core/file_format/pkg_type.h"

View file

@ -16,6 +16,7 @@
#include <QVBoxLayout>
#include <QWidget>
#include <QXmlStreamReader>
#include "common/types.h"
#include "core/file_format/trp.h"