Skip to content

Commit b0b1529

Browse files
DanielSvobodaXphalnos
authored andcommitted
Help - improvement (shadps4-emu#1522)
* Help - improvement * Adding shadow below icons * Adding keys icon + Update changelog * color according to the selected theme * submenu 'Keys and Shortcuts' * clang * + * remove keys_shortcuts --------- Co-authored-by: ¥IGA <[email protected]>
1 parent 337b9be commit b0b1529

File tree

12 files changed

+388
-13
lines changed

12 files changed

+388
-13
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,4 +1014,4 @@ if (ENABLE_QT_GUI AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
10141014
install(FILES "dist/net.shadps4.shadPS4.metainfo.xml" DESTINATION "share/metainfo")
10151015
install(FILES ".github/shadps4.png" DESTINATION "share/icons/hicolor/512x512/apps" RENAME "net.shadps4.shadPS4.png")
10161016
install(FILES "src/images/net.shadps4.shadPS4.svg" DESTINATION "share/icons/hicolor/scalable/apps")
1017-
endif()
1017+
endif()

REUSE.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ path = [
1212
"dist/net.shadps4.shadPS4_metadata.pot",
1313
"dist/net.shadps4.shadPS4.metainfo.xml",
1414
"dist/net.shadps4.shadPS4.releases.xml",
15-
"documents/changelog.txt",
15+
"documents/changelog.md",
1616
"documents/Quickstart/2.png",
1717
"documents/Screenshots/*",
1818
"scripts/ps4_names.txt",
1919
"src/images/about_icon.png",
2020
"src/images/controller_icon.png",
21+
"src/images/discord.png",
2122
"src/images/dump_icon.png",
2223
"src/images/exit_icon.png",
2324
"src/images/file_icon.png",
@@ -28,8 +29,10 @@ path = [
2829
"src/images/flag_us.png",
2930
"src/images/flag_world.png",
3031
"src/images/folder_icon.png",
32+
"src/images/github.png",
3133
"src/images/grid_icon.png",
3234
"src/images/iconsize_icon.png",
35+
"src/images/ko-fi.png",
3336
"src/images/list_icon.png",
3437
"src/images/list_mode_icon.png",
3538
"src/images/pause_icon.png",
@@ -43,6 +46,8 @@ path = [
4346
"src/images/net.shadps4.shadPS4.svg",
4447
"src/images/themes_icon.png",
4548
"src/images/update_icon.png",
49+
"src/images/youtube.png",
50+
"src/images/website.png",
4651
"src/shadps4.qrc",
4752
"src/shadps4.rc",
4853
]

documents/changelog.txt renamed to documents/changelog.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
v0.4.0 31/10/2024 - codename divicius
2+
=================
3+
4+
- Shader recompiler fixes
5+
- Emulated support for cpus that doesn't have SSE4.2a (intel cpus)
6+
- Frame graph + Precise 60 fps timing
7+
- Save data: fix nullptr & concurrent file write
8+
- Auto Update
9+
- Error dialog implementation
10+
- Swapchain recreation and window resizing
11+
- Add playback of background/title music in game list
12+
- Kernel: Quiet sceKernelWaitEventFlag error log on timeout
13+
- Improve keyboard navigation in game list
14+
- core/memory: Pooled memory implementation
15+
- Fix PKG loading
16+
- replace trophy xml assert with error
17+
- Refactor audio handling with range checks, buffer threshold, and lock
18+
- audio_core: Fix return value types and shift some error handling to library
19+
- Devtools: PM4 Explorer
20+
- Initial support of Geometry shaders
21+
- Working touchpad support
22+
- net: Stub sceNetErrnoLoc
23+
- Add support to click touchpad using back button on non PS4/5 controllers
24+
- Multiple Install Folders
25+
- Using a more standard data directory for linux
26+
- video_core: Implement sceGnmInsertPushColorMarker
27+
- ime_dialog: Initial implementation
28+
- Network libs fixes
29+
- Use GetSystemTimePreciseAsFileTime to fix fps timing issues
30+
- Added adaptive mutex initializer
31+
- Small Np + trophy fixes
32+
- Separate Updates from Game Folder
33+
- Minor Fixes for Separate Update Folder
34+
- AvPlayer: Do not align w/h to 16 with vdec2
35+
- Improve sceSystemServiceReceiveEvent stub
36+
- renderer_vulkan: Commize and adjust buffer bindings
37+
- Add poll interval to libScePad
38+
- Add more surface format mappings.
39+
- vulkan: Report only missing format feature flags.
40+
- IME implementation
41+
- Videodec2 implementation
42+
- path_util: Make sure macOS has current directory set and clean up path code.
43+
- Load LLE modules from sys_modules/GAMEID folder
44+
145
v0.3.0 23/09/2024 - codename broamic
246
=================
347

src/images/discord.png

66.9 KB
Loading

src/images/github.png

114 KB
Loading

src/images/ko-fi.png

38.6 KB
Loading

src/images/website.png

88.7 KB
Loading

src/images/youtube.png

38.5 KB
Loading

src/qt_gui/about_dialog.cpp

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,194 @@
11
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
22
// SPDX-License-Identifier: GPL-2.0-or-later
33

4+
#include <QDesktopServices>
5+
#include <QEvent>
6+
#include <QGraphicsDropShadowEffect>
7+
#include <QImage>
8+
#include <QLabel>
9+
#include <QPixmap>
10+
#include <common/config.h>
411
#include "about_dialog.h"
12+
#include "main_window_themes.h"
513
#include "ui_about_dialog.h"
614

715
AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) {
816
ui->setupUi(this);
17+
preloadImages();
18+
19+
ui->image_1->setAttribute(Qt::WA_Hover, true);
20+
ui->image_2->setAttribute(Qt::WA_Hover, true);
21+
ui->image_3->setAttribute(Qt::WA_Hover, true);
22+
ui->image_4->setAttribute(Qt::WA_Hover, true);
23+
ui->image_5->setAttribute(Qt::WA_Hover, true);
24+
25+
ui->image_1->installEventFilter(this);
26+
ui->image_2->installEventFilter(this);
27+
ui->image_3->installEventFilter(this);
28+
ui->image_4->installEventFilter(this);
29+
ui->image_5->installEventFilter(this);
930
}
1031

1132
AboutDialog::~AboutDialog() {
1233
delete ui;
1334
}
35+
36+
void AboutDialog::preloadImages() {
37+
originalImages[0] = ui->image_1->pixmap().copy();
38+
originalImages[1] = ui->image_2->pixmap().copy();
39+
originalImages[2] = ui->image_3->pixmap().copy();
40+
originalImages[3] = ui->image_4->pixmap().copy();
41+
originalImages[4] = ui->image_5->pixmap().copy();
42+
43+
for (int i = 0; i < 5; ++i) {
44+
QImage image = originalImages[i].toImage();
45+
for (int y = 0; y < image.height(); ++y) {
46+
for (int x = 0; x < image.width(); ++x) {
47+
QColor color = image.pixelColor(x, y);
48+
color.setRed(255 - color.red());
49+
color.setGreen(255 - color.green());
50+
color.setBlue(255 - color.blue());
51+
image.setPixelColor(x, y, color);
52+
}
53+
}
54+
invertedImages[i] = QPixmap::fromImage(image);
55+
}
56+
updateImagesForCurrentTheme();
57+
}
58+
59+
void AboutDialog::updateImagesForCurrentTheme() {
60+
Theme currentTheme = static_cast<Theme>(Config::getMainWindowTheme());
61+
bool isDarkTheme = (currentTheme == Theme::Dark || currentTheme == Theme::Green ||
62+
currentTheme == Theme::Blue || currentTheme == Theme::Violet);
63+
if (isDarkTheme) {
64+
ui->image_1->setPixmap(invertedImages[0]);
65+
ui->image_2->setPixmap(invertedImages[1]);
66+
ui->image_3->setPixmap(invertedImages[2]);
67+
ui->image_4->setPixmap(invertedImages[3]);
68+
ui->image_5->setPixmap(invertedImages[4]);
69+
} else {
70+
ui->image_1->setPixmap(originalImages[0]);
71+
ui->image_2->setPixmap(originalImages[1]);
72+
ui->image_3->setPixmap(originalImages[2]);
73+
ui->image_4->setPixmap(originalImages[3]);
74+
ui->image_5->setPixmap(originalImages[4]);
75+
}
76+
}
77+
78+
bool AboutDialog::eventFilter(QObject* obj, QEvent* event) {
79+
if (event->type() == QEvent::Enter) {
80+
if (obj == ui->image_1) {
81+
if (isDarkTheme()) {
82+
ui->image_1->setPixmap(originalImages[0]);
83+
} else {
84+
ui->image_1->setPixmap(invertedImages[0]);
85+
}
86+
applyHoverEffect(ui->image_1);
87+
} else if (obj == ui->image_2) {
88+
if (isDarkTheme()) {
89+
ui->image_2->setPixmap(originalImages[1]);
90+
} else {
91+
ui->image_2->setPixmap(invertedImages[1]);
92+
}
93+
applyHoverEffect(ui->image_2);
94+
} else if (obj == ui->image_3) {
95+
if (isDarkTheme()) {
96+
ui->image_3->setPixmap(originalImages[2]);
97+
} else {
98+
ui->image_3->setPixmap(invertedImages[2]);
99+
}
100+
applyHoverEffect(ui->image_3);
101+
} else if (obj == ui->image_4) {
102+
if (isDarkTheme()) {
103+
ui->image_4->setPixmap(originalImages[3]);
104+
} else {
105+
ui->image_4->setPixmap(invertedImages[3]);
106+
}
107+
applyHoverEffect(ui->image_4);
108+
} else if (obj == ui->image_5) {
109+
if (isDarkTheme()) {
110+
ui->image_5->setPixmap(originalImages[4]);
111+
} else {
112+
ui->image_5->setPixmap(invertedImages[4]);
113+
}
114+
applyHoverEffect(ui->image_5);
115+
}
116+
} else if (event->type() == QEvent::Leave) {
117+
if (obj == ui->image_1) {
118+
if (isDarkTheme()) {
119+
ui->image_1->setPixmap(invertedImages[0]);
120+
} else {
121+
ui->image_1->setPixmap(originalImages[0]);
122+
}
123+
removeHoverEffect(ui->image_1);
124+
} else if (obj == ui->image_2) {
125+
if (isDarkTheme()) {
126+
ui->image_2->setPixmap(invertedImages[1]);
127+
} else {
128+
ui->image_2->setPixmap(originalImages[1]);
129+
}
130+
removeHoverEffect(ui->image_2);
131+
} else if (obj == ui->image_3) {
132+
if (isDarkTheme()) {
133+
ui->image_3->setPixmap(invertedImages[2]);
134+
} else {
135+
ui->image_3->setPixmap(originalImages[2]);
136+
}
137+
removeHoverEffect(ui->image_3);
138+
} else if (obj == ui->image_4) {
139+
if (isDarkTheme()) {
140+
ui->image_4->setPixmap(invertedImages[3]);
141+
} else {
142+
ui->image_4->setPixmap(originalImages[3]);
143+
}
144+
removeHoverEffect(ui->image_4);
145+
} else if (obj == ui->image_5) {
146+
if (isDarkTheme()) {
147+
ui->image_5->setPixmap(invertedImages[4]);
148+
} else {
149+
ui->image_5->setPixmap(originalImages[4]);
150+
}
151+
removeHoverEffect(ui->image_5);
152+
}
153+
} else if (event->type() == QEvent::MouseButtonPress) {
154+
if (obj == ui->image_1) {
155+
QDesktopServices::openUrl(QUrl("https://github.com/shadps4-emu/shadPS4"));
156+
} else if (obj == ui->image_2) {
157+
QDesktopServices::openUrl(QUrl("https://discord.gg/bFJxfftGW6"));
158+
} else if (obj == ui->image_3) {
159+
QDesktopServices::openUrl(QUrl("https://www.youtube.com/@shadPS4/videos"));
160+
} else if (obj == ui->image_4) {
161+
QDesktopServices::openUrl(QUrl("https://ko-fi.com/shadps4"));
162+
} else if (obj == ui->image_5) {
163+
QDesktopServices::openUrl(QUrl("https://shadps4.net"));
164+
}
165+
return true;
166+
}
167+
return QDialog::eventFilter(obj, event);
168+
}
169+
170+
void AboutDialog::applyHoverEffect(QLabel* label) {
171+
QColor shadowColor = isDarkTheme() ? QColor(0, 0, 0) : QColor(169, 169, 169);
172+
QGraphicsDropShadowEffect* shadow = new QGraphicsDropShadowEffect;
173+
shadow->setBlurRadius(5);
174+
shadow->setXOffset(2);
175+
shadow->setYOffset(2);
176+
shadow->setColor(shadowColor);
177+
label->setGraphicsEffect(shadow);
178+
}
179+
180+
void AboutDialog::removeHoverEffect(QLabel* label) {
181+
QColor shadowColor = isDarkTheme() ? QColor(50, 50, 50) : QColor(169, 169, 169);
182+
QGraphicsDropShadowEffect* shadow = new QGraphicsDropShadowEffect;
183+
shadow->setBlurRadius(3);
184+
shadow->setXOffset(0);
185+
shadow->setYOffset(0);
186+
shadow->setColor(shadowColor);
187+
label->setGraphicsEffect(shadow);
188+
}
189+
190+
bool AboutDialog::isDarkTheme() const {
191+
Theme currentTheme = static_cast<Theme>(Config::getMainWindowTheme());
192+
return currentTheme == Theme::Dark || currentTheme == Theme::Green ||
193+
currentTheme == Theme::Blue || currentTheme == Theme::Violet;
194+
}

src/qt_gui/about_dialog.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
#pragma once
55

6+
#include <QDesktopServices>
67
#include <QDialog>
8+
#include <QLabel>
9+
#include <QPixmap>
10+
#include <QUrl>
711

812
namespace Ui {
913
class AboutDialog;
@@ -15,7 +19,18 @@ class AboutDialog : public QDialog {
1519
public:
1620
explicit AboutDialog(QWidget* parent = nullptr);
1721
~AboutDialog();
22+
bool eventFilter(QObject* obj, QEvent* event);
1823

1924
private:
2025
Ui::AboutDialog* ui;
21-
};
26+
27+
void preloadImages();
28+
void updateImagesForCurrentTheme();
29+
void applyHoverEffect(QLabel* label);
30+
void removeHoverEffect(QLabel* label);
31+
32+
bool isDarkTheme() const;
33+
34+
QPixmap originalImages[5];
35+
QPixmap invertedImages[5];
36+
};

0 commit comments

Comments
 (0)