Fix code review remarks from George

1. Removed keyboard icon, used controller instead
2. Added tabs to controller setup window
3. Fixed (hopefully) the reason why controller scheme won't show up in release executable retrieved from GitHub's pipeline (while local executable works fine)
This commit is contained in:
Vasyl Baran 2024-08-21 11:54:30 +03:00
parent 0a2a261a02
commit b9c988829d
9 changed files with 394 additions and 490 deletions

View File

@ -15,9 +15,9 @@ Files: CMakeSettings.json
documents/Screenshots/Undertale.png
documents/Screenshots/We are DOOMED.png
scripts/ps4_names.txt
src/images/PS4_controller_scheme.png
src/images/about_icon.png
src/images/controller_icon.png
src/images/keyboard_icon.png
src/images/exit_icon.png
src/images/file_icon.png
src/images/flag_china.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,100 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!--
SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later
-->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 868.8 514" style="enable-background:new 0 0 868.8 514;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#747474;stroke-width:2;stroke-linecap:round;}
.st1{opacity:0.5;}
.st2{fill:none;stroke:#747474;stroke-width:4;}
.st3{fill:none;stroke:#747474;stroke-width:3;}
.st4{fill:none;stroke:#747474;stroke-width:2;}
.st5{fill:none;}
</style>
<g id="Layer_2_00000097496210553772954770000012093511300866492585_">
<g id="Layer_1-2">
<g id="ps4_android">
<path id="路径_4780" class="st0" d="M1,1h170.8"/>
<path id="路径_4820" class="st0" d="M1,69.3h170.8"/>
<path id="路径_4865" class="st0" d="M1,197h152.1"/>
<path id="路径_4894_00000013184940780502961700000014303813344279000497_" class="st0" d="M270.1,296"/>
<path id="路径_4894_00000017504210865169069830000017699973930485000372_" class="st0" d="M1,296"/>
<path id="路径_3656" class="st0" d="M659.3,195.7l65.7,78.6"/>
<path id="路径_3657" class="st0" d="M734.3,198.7l6.7,7.4"/>
<path id="路径_4866" class="st0" d="M866.3,137.7H689.1"/>
<path id="路径_4867" class="st0" d="M866.3,206H741.1"/>
<path id="路径_4868" class="st0" d="M659.1,196h-27"/>
<path id="路径_4895" class="st0" d="M867.8,274.3H725.1"/>
<path id="路径_4896" class="st0" d="M867.8,342.7H734.1"/>
<path id="路径_4869" class="st0" d="M682.5,144.1l6.6-6.5"/>
<path id="路径_3658" class="st0" d="M671.6,270.6l62.5,72"/>
<path id="路径_4821" class="st0" d="M185.2,84.2l-13.4-14.9"/>
<path id="路径_4781" class="st0" d="M172.6,1.7L235,73"/>
<path id="路径_4782" class="st0" d="M866.3,1H695.5"/>
<path id="路径_4822" class="st0" d="M866.3,69.3H695.5"/>
<path id="路径_4823" class="st0" d="M682.1,84.2l13.4-14.9"/>
<path id="路径_4783" class="st0" d="M694.7,1.7L632.3,73"/>
<path id="路径_4897" class="st0" d="M322.9,304v96.5"/>
<path id="路径_4824" class="st0" d="M294.9,28v96.6"/>
<path id="路径_4825" class="st0" d="M581.9,28v96.6"/>
<path id="路径_4898" class="st0" d="M434.8,323.4v78.7"/>
<path id="路径_4899" class="st0" d="M547.2,304v98"/>
<path id="路径_4934_00000028290396629278709680000017707286295783229854_" class="st0" d="M697.1,410.7"/>
<path id="路径_4934_00000083058795991008605930000003412791582934853814_" class="st0" d="M867.8,410.7"/>
<path id="路径_3659_00000059269749574209402570000011115938241451306122_" class="st0" d="M697.6,410.6"/>
<path id="路径_3659_00000060009886666316406710000007170877077051697029_" class="st0" d="M597.6,295.6"/>
<g id="ps4pro">
<g id="组_4415" class="st1">
<g id="组_4404">
<path id="路径_3" class="st2" d="M322.1,94.8c0,0-23.6,11.6-58.7,0V83.3c-5.8-2.6-13.7-5.2-27.5-6.4
c-24-2.1-41.2,0.1-58,11.3v4.3c-2.5,1.6-4.7,3.6-6.6,5.8c-12.2,14.3-47.3,74.3-66.1,179.6c-9.7,54.2-16.9,97.4-18.8,130
c-4,42.2,11.4,65.9,11.4,65.9c33,47.9,79.6,37.1,79.6,37.1c16.9-3.8,43.9-15,53.2-49.4c0,0,22.7-92.4,33.9-99.1
c12.2-7.4,11.7-8.9,15.4-8s18.8,13.1,37,13.6s32.5-2.2,40-7s12.4-11.1,14.1-11.2c0.9,0,23.2,0,44.5,0l0,0h19.6"/>
<path id="路径_3398" class="st3" d="M337.6,85.9h193.9c9.9,0,17.8,8,17.8,17.9c0,0,0,0,0,0V195c0,9.9-7.9,17.9-17.8,17.9
c0,0,0,0,0,0H337.6c-9.9,0-17.9-8-17.8-17.9c0,0,0,0,0,0v-91.2C319.7,93.9,327.7,85.9,337.6,85.9
C337.6,85.9,337.6,85.9,337.6,85.9z"/>
<circle id="椭圆_5" class="st4" cx="323.2" cy="292" r="27.6"/>
<circle id="椭圆_8" class="st4" cx="546.3" cy="292" r="27.7"/>
<circle id="椭圆_9" class="st3" cx="655.2" cy="145.4" r="21.8"/>
<circle id="椭圆_10" class="st3" cx="707.4" cy="195.6" r="21.8"/>
<circle id="椭圆_11" class="st3" cx="657.2" cy="248.2" r="21.8"/>
<circle id="椭圆_12" class="st3" cx="604.5" cy="195.6" r="21.8"/>
<path id="路径_11" class="st4" d="M201.1,140.7h22.4c4.1,0,7.5,3.4,7.5,7.5v19.6c0,2-0.8,3.9-2.2,5.3L218,184
c-2.9,2.9-7.7,2.9-10.6,0l-11.2-11.2c-1.4-1.4-2.2-3.2-2.2-5.2l-0.3-19.3C193.6,144.2,196.9,140.8,201.1,140.7L201.1,140.7z"
/>
<path id="路径_12" class="st4" d="M267.7,185.8v22.4c0,4.1-3.4,7.5-7.5,7.5h-19.6c-2,0-3.9-0.8-5.3-2.2l-10.9-10.9
c-2.9-2.9-2.9-7.7,0-10.6c0,0,0,0,0,0l11.2-11.2c1.4-1.4,3.2-2.2,5.2-2.2l19.3-0.3c4.1-0.1,7.6,3.2,7.6,7.4c0,0,0,0,0,0V185.8
z"/>
<path id="路径_13" class="st4" d="M156.7,208.2v-22.4c0-4.1,3.4-7.5,7.5-7.5h19.6c2,0,3.9,0.8,5.3,2.2l10.9,10.9
c2.9,2.9,2.9,7.7,0,10.6c0,0,0,0,0,0l-11.2,11.2c-1.4,1.4-3.2,2.2-5.2,2.2l-19.3,0.3c-4.1,0.1-7.6-3.2-7.6-7.4c0,0,0,0,0,0
V208.2z"/>
<path id="路径_14" class="st4" d="M223.5,253.1h-22.4c-4.1,0-7.5-3.4-7.5-7.5V226c0-2,0.8-3.9,2.2-5.3l10.9-10.9
c2.9-2.9,7.7-2.9,10.6,0l11.2,11.2c1.4,1.4,2.2,3.2,2.2,5.2l0.3,19.3c0.1,4.1-3.2,7.5-7.4,7.6L223.5,253.1z"/>
<path id="矩形_23" class="st4" d="M581.2,107.2L581.2,107.2c6.5,0,11.7,5.2,11.7,11.7c0,0,0,0,0,0V135
c0,6.5-5.2,11.7-11.7,11.7l0,0l0,0c-6.5,0-11.7-5.2-11.7-11.7c0,0,0,0,0,0v-16.1C569.5,112.5,574.7,107.2,581.2,107.2
C581.2,107.2,581.2,107.2,581.2,107.2z"/>
<path id="路径_3404" class="st2" d="M546.2,94.8c0,0,23.6,11.6,58.7,0V83.3c5.8-2.6,13.7-5.2,27.5-6.4
c24-2.1,41.2,0.1,58,11.3v4.3c2.5,1.6,4.7,3.6,6.6,5.8c12.2,14.3,47.3,74.3,66.1,179.6c9.7,54.2,16.9,97.4,18.8,130
c4,42.2-11.4,65.9-11.4,65.9C737.6,521.7,691,511,691,511c-16.9-3.8-43.9-15-53.2-49.4c0,0-22.7-92.4-33.8-99.1
c-12.2-7.4-11.7-8.9-15.4-8s-18.8,13-37,13.5s-32.5-2.2-40-7s-12.4-11.1-14.1-11.2c-0.9,0-23.2,0-44.5,0l0,0h-19.6"/>
<circle id="椭圆_2218" class="st4" cx="434.1" cy="297.5" r="20"/>
<path id="矩形_742" class="st4" d="M295,109.9L295,109.9c6.5,0,11.7,5.2,11.7,11.7c0,0,0,0,0,0v16.1
c0,6.5-5.2,11.7-11.7,11.7l0,0l0,0c-6.5,0-11.7-5.2-11.7-11.7c0,0,0,0,0,0v-16.1C283.3,115.2,288.5,109.9,295,109.9z"/>
</g>
<g id="椭圆_2190">
<circle class="st5" cx="321.7" cy="292.4" r="47.8"/>
<circle class="st2" cx="321.7" cy="292.4" r="45.8"/>
</g>
<g id="椭圆_2209">
<circle class="st5" cx="545.6" cy="292.4" r="47.8"/>
<circle class="st2" cx="545.6" cy="292.4" r="45.8"/>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -10,8 +10,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
<rect>
<x>0</x>
<y>0</y>
<width>1148</width>
<height>731</height>
<width>1155</width>
<height>790</height>
</rect>
</property>
<property name="sizePolicy">
@ -28,23 +28,39 @@ SPDX-License-Identifier: GPL-2.0-or-later
</property>
<property name="maximumSize">
<size>
<width>1148</width>
<height>731</height>
<width>1155</width>
<height>790</height>
</size>
</property>
<property name="windowTitle">
<string>Configure Keyboard Bindings</string>
<string>Configure Controller Bindings</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>1131</width>
<height>711</height>
</rect>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="port_1">
<attribute name="title">
<string>Port 1</string>
</attribute>
<widget class="QWidget" name="centralwidget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1151</width>
<height>722</height>
<x>-10</x>
<y>20</y>
<width>1131</width>
<height>621</height>
</rect>
</property>
<widget class="QWidget" name="bgWidget" native="true">
@ -60,11 +76,10 @@ SPDX-License-Identifier: GPL-2.0-or-later
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">QWidget {
background-image: url(:/images/PS4_controller_scheme_final.svg);
<string notr="true"> QWidget { background-image: url(:images/PS4_controller_scheme.png);
background-repeat: no-repeat;
background-position: center;
}</string>
background-position: center; }
</string>
</property>
<widget class="QKeySequenceEdit" name="StartKeySequenceEdit">
<property name="geometry">
@ -384,24 +399,19 @@ SPDX-License-Identifier: GPL-2.0-or-later
<longLong>1</longLong>
</property>
</widget>
<widget class="QPushButton" name="cancelButton">
<property name="geometry">
<rect>
<x>890</x>
<y>670</y>
<width>100</width>
<height>32</height>
</rect>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="port_2">
<attribute name="title">
<string>Port 2</string>
</attribute>
</widget>
</widget>
<widget class="QPushButton" name="applyButton">
<property name="geometry">
<rect>
<x>1000</x>
<y>670</y>
<x>1030</x>
<y>740</y>
<width>100</width>
<height>32</height>
</rect>
@ -410,16 +420,18 @@ SPDX-License-Identifier: GPL-2.0-or-later
<string>Apply</string>
</property>
</widget>
</widget>
<widget class="QStatusBar" name="statusbar">
<widget class="QPushButton" name="cancelButton">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>20</width>
<height>22</height>
<x>890</x>
<y>740</y>
<width>100</width>
<height>32</height>
</rect>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</widget>
<resources/>

View File

@ -52,7 +52,7 @@ bool MainWindow::Init() {
auto end = std::chrono::steady_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
statusBar.reset(new QStatusBar);
m_keyboardControlsDialog.reset(new KeyboardControlsWindow());
m_controllerControlsDialog.reset(new KeyboardControlsWindow());
this->setStatusBar(statusBar.data());
// Update status bar
int numGames = m_game_info->m_games.size();
@ -92,11 +92,10 @@ void MainWindow::AddUiWidgets() {
ui->toolBar->addWidget(ui->pauseButton);
ui->toolBar->addWidget(ui->stopButton);
ui->toolBar->addWidget(ui->settingsButton);
ui->toolBar->addWidget(ui->controllerButton);
auto connection = QObject::connect(ui->keyboardButton, &QPushButton::clicked, this,
&MainWindow::KeyboardConfigurationButtonPressed);
auto connection = QObject::connect(ui->controllerButton, &QPushButton::clicked, this,
&MainWindow::ControllerConfigurationButtonPressed);
ui->toolBar->addWidget(ui->keyboardButton);
ui->toolBar->addWidget(ui->controllerButton);
QFrame* line = new QFrame(this);
line->setFrameShape(QFrame::StyledPanel);
line->setFrameShadow(QFrame::Sunken);
@ -105,8 +104,8 @@ void MainWindow::AddUiWidgets() {
ui->toolBar->addWidget(ui->mw_searchbar);
}
void MainWindow::KeyboardConfigurationButtonPressed() {
m_keyboardControlsDialog->show();
void MainWindow::ControllerConfigurationButtonPressed() {
m_controllerControlsDialog->show();
}
void MainWindow::CreateDockWindows() {
@ -660,7 +659,7 @@ void MainWindow::InstallDirectory() {
}
std::map<u32, KeysMapping> MainWindow::getKeysMapping() {
return m_keyboardControlsDialog->getKeysMapping();
return m_controllerControlsDialog->getKeysMapping();
}
void MainWindow::SetLastUsedTheme() {
@ -738,7 +737,6 @@ void MainWindow::SetUiIcons(bool isWhite) {
ui->stopButton->setIcon(RecolorIcon(ui->stopButton->icon(), isWhite));
ui->settingsButton->setIcon(RecolorIcon(ui->settingsButton->icon(), isWhite));
ui->controllerButton->setIcon(RecolorIcon(ui->controllerButton->icon(), isWhite));
ui->keyboardButton->setIcon(RecolorIcon(ui->keyboardButton->icon(), isWhite));
ui->refreshGameListAct->setIcon(RecolorIcon(ui->refreshGameListAct->icon(), isWhite));
ui->menuGame_List_Mode->setIcon(RecolorIcon(ui->menuGame_List_Mode->icon(), isWhite));
ui->pkgViewerAct->setIcon(RecolorIcon(ui->pkgViewerAct->icon(), isWhite));

View File

@ -51,7 +51,7 @@ private Q_SLOTS:
void ShowGameList();
void RefreshGameTable();
void HandleResize(QResizeEvent* event);
void KeyboardConfigurationButtonPressed();
void ControllerConfigurationButtonPressed();
private:
Ui_MainWindow* ui;
@ -86,7 +86,7 @@ private:
QScopedPointer<ElfViewer> m_elf_viewer;
// Status Bar.
QScopedPointer<QStatusBar> statusBar;
QScopedPointer<KeyboardControlsWindow> m_keyboardControlsDialog;
QScopedPointer<KeyboardControlsWindow> m_controllerControlsDialog;
// Available GPU devices
std::vector<QString> m_physical_devices;

View File

@ -59,7 +59,6 @@ public:
QPushButton* stopButton;
QPushButton* settingsButton;
QPushButton* controllerButton;
QPushButton* keyboardButton;
QWidget* sizeSliderContainer;
QHBoxLayout* sizeSliderContainer_layout;
@ -203,10 +202,6 @@ public:
controllerButton->setFlat(true);
controllerButton->setIcon(QIcon(":images/controller_icon.png"));
controllerButton->setIconSize(QSize(40, 40));
keyboardButton = new QPushButton(centralWidget);
keyboardButton->setFlat(true);
keyboardButton->setIcon(QIcon(":images/keyboard_icon.png"));
keyboardButton->setIconSize(QSize(40, 40));
sizeSliderContainer = new QWidget(centralWidget);
sizeSliderContainer->setObjectName("sizeSliderContainer");

View File

@ -14,8 +14,7 @@
<file>images/exit_icon.png</file>
<file>images/settings_icon.png</file>
<file>images/controller_icon.png</file>
<file>images/keyboard_icon.png</file>
<file>images/PS4_controller_scheme_final.svg</file>
<file>images/PS4_controller_scheme.png</file>
<file>images/refresh_icon.png</file>
<file>images/list_mode_icon.png</file>
<file>images/flag_jp.png</file>