diff options
Diffstat (limited to '')
| -rw-r--r-- | dist/qt_themes/default/style.qss | 20 | ||||
| -rw-r--r-- | dist/qt_themes/qdarkstyle/style.qss | 21 | ||||
| -rw-r--r-- | dist/qt_themes/qdarkstyle_midnight_blue/style.qss | 21 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 80 | ||||
| -rw-r--r-- | src/yuzu/main.h | 4 |
5 files changed, 107 insertions, 39 deletions
diff --git a/dist/qt_themes/default/style.qss b/dist/qt_themes/default/style.qss index cee219374..9915a40ba 100644 --- a/dist/qt_themes/default/style.qss +++ b/dist/qt_themes/default/style.qss | |||
| @@ -38,6 +38,26 @@ QPushButton#RendererStatusBarButton:!checked { | |||
| 38 | color: #0066ff; | 38 | color: #0066ff; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | QPushButton#GPUStatusBarButton { | ||
| 42 | color: #656565; | ||
| 43 | border: 1px solid transparent; | ||
| 44 | background-color: transparent; | ||
| 45 | padding: 0px 3px 0px 3px; | ||
| 46 | text-align: center; | ||
| 47 | } | ||
| 48 | |||
| 49 | QPushButton#GPUStatusBarButton:hover { | ||
| 50 | border: 1px solid #76797C; | ||
| 51 | } | ||
| 52 | |||
| 53 | QPushButton#GPUStatusBarButton:checked { | ||
| 54 | color: #ff8040; | ||
| 55 | } | ||
| 56 | |||
| 57 | QPushButton#GPUStatusBarButton:!checked { | ||
| 58 | color: #40dd40; | ||
| 59 | } | ||
| 60 | |||
| 41 | QPushButton#buttonRefreshDevices { | 61 | QPushButton#buttonRefreshDevices { |
| 42 | min-width: 21px; | 62 | min-width: 21px; |
| 43 | min-height: 21px; | 63 | min-height: 21px; |
diff --git a/dist/qt_themes/qdarkstyle/style.qss b/dist/qt_themes/qdarkstyle/style.qss index 3d0ccbb9e..dac2dba86 100644 --- a/dist/qt_themes/qdarkstyle/style.qss +++ b/dist/qt_themes/qdarkstyle/style.qss | |||
| @@ -1283,6 +1283,27 @@ QPushButton#RendererStatusBarButton:!checked { | |||
| 1283 | color: #00ccdd; | 1283 | color: #00ccdd; |
| 1284 | } | 1284 | } |
| 1285 | 1285 | ||
| 1286 | QPushButton#GPUStatusBarButton { | ||
| 1287 | min-width: 0px; | ||
| 1288 | color: #656565; | ||
| 1289 | border: 1px solid transparent; | ||
| 1290 | background-color: transparent; | ||
| 1291 | padding: 0px 3px 0px 3px; | ||
| 1292 | text-align: center; | ||
| 1293 | } | ||
| 1294 | |||
| 1295 | QPushButton#GPUStatusBarButton:hover { | ||
| 1296 | border: 1px solid #76797C; | ||
| 1297 | } | ||
| 1298 | |||
| 1299 | QPushButton#GPUStatusBarButton:checked { | ||
| 1300 | color: #ff8040; | ||
| 1301 | } | ||
| 1302 | |||
| 1303 | QPushButton#GPUStatusBarButton:!checked { | ||
| 1304 | color: #40dd40; | ||
| 1305 | } | ||
| 1306 | |||
| 1286 | QPushButton#buttonRefreshDevices { | 1307 | QPushButton#buttonRefreshDevices { |
| 1287 | min-width: 23px; | 1308 | min-width: 23px; |
| 1288 | min-height: 23px; | 1309 | min-height: 23px; |
diff --git a/dist/qt_themes/qdarkstyle_midnight_blue/style.qss b/dist/qt_themes/qdarkstyle_midnight_blue/style.qss index 51bec2fd7..032d05ec6 100644 --- a/dist/qt_themes/qdarkstyle_midnight_blue/style.qss +++ b/dist/qt_themes/qdarkstyle_midnight_blue/style.qss | |||
| @@ -2186,6 +2186,27 @@ QPushButton#RendererStatusBarButton:!checked { | |||
| 2186 | color: #00ccdd; | 2186 | color: #00ccdd; |
| 2187 | } | 2187 | } |
| 2188 | 2188 | ||
| 2189 | QPushButton#GPUStatusBarButton { | ||
| 2190 | min-width: 0px; | ||
| 2191 | color: #656565; | ||
| 2192 | border: 1px solid transparent; | ||
| 2193 | background-color: transparent; | ||
| 2194 | padding: 0px 3px 0px 3px; | ||
| 2195 | text-align: center; | ||
| 2196 | } | ||
| 2197 | |||
| 2198 | QPushButton#GPUStatusBarButton:hover { | ||
| 2199 | border: 1px solid #76797C; | ||
| 2200 | } | ||
| 2201 | |||
| 2202 | QPushButton#GPUStatusBarButton:checked { | ||
| 2203 | color: #ff8040; | ||
| 2204 | } | ||
| 2205 | |||
| 2206 | QPushButton#GPUStatusBarButton:!checked { | ||
| 2207 | color: #40dd40; | ||
| 2208 | } | ||
| 2209 | |||
| 2189 | QPushButton#buttonRefreshDevices { | 2210 | QPushButton#buttonRefreshDevices { |
| 2190 | min-width: 19px; | 2211 | min-width: 19px; |
| 2191 | min-height: 19px; | 2212 | min-height: 19px; |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e97bfd976..2f84ada73 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -789,41 +789,28 @@ void GMainWindow::InitializeWidgets() { | |||
| 789 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); | 789 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); |
| 790 | statusBar()->insertPermanentWidget(0, dock_status_button); | 790 | statusBar()->insertPermanentWidget(0, dock_status_button); |
| 791 | 791 | ||
| 792 | // Setup ASync button | 792 | gpu_accuracy_button = new QPushButton(); |
| 793 | async_status_button = new QPushButton(); | 793 | gpu_accuracy_button->setObjectName(QStringLiteral("GPUStatusBarButton")); |
| 794 | async_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton")); | 794 | gpu_accuracy_button->setCheckable(true); |
| 795 | async_status_button->setFocusPolicy(Qt::NoFocus); | 795 | gpu_accuracy_button->setFocusPolicy(Qt::NoFocus); |
| 796 | connect(async_status_button, &QPushButton::clicked, [&] { | 796 | connect(gpu_accuracy_button, &QPushButton::clicked, [this] { |
| 797 | if (emulation_running) { | 797 | switch (Settings::values.gpu_accuracy.GetValue()) { |
| 798 | return; | 798 | case Settings::GPUAccuracy::High: { |
| 799 | Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::Normal); | ||
| 800 | break; | ||
| 801 | } | ||
| 802 | case Settings::GPUAccuracy::Normal: | ||
| 803 | case Settings::GPUAccuracy::Extreme: | ||
| 804 | default: { | ||
| 805 | Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::High); | ||
| 799 | } | 806 | } |
| 800 | Settings::values.use_asynchronous_gpu_emulation.SetValue( | ||
| 801 | !Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 802 | async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 803 | Core::System::GetInstance().ApplySettings(); | ||
| 804 | }); | ||
| 805 | async_status_button->setText(tr("ASYNC")); | ||
| 806 | async_status_button->setCheckable(true); | ||
| 807 | async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 808 | |||
| 809 | // Setup Multicore button | ||
| 810 | multicore_status_button = new QPushButton(); | ||
| 811 | multicore_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton")); | ||
| 812 | multicore_status_button->setFocusPolicy(Qt::NoFocus); | ||
| 813 | connect(multicore_status_button, &QPushButton::clicked, [&] { | ||
| 814 | if (emulation_running) { | ||
| 815 | return; | ||
| 816 | } | 807 | } |
| 817 | Settings::values.use_multi_core.SetValue(!Settings::values.use_multi_core.GetValue()); | 808 | |
| 818 | multicore_status_button->setChecked(Settings::values.use_multi_core.GetValue()); | ||
| 819 | Core::System::GetInstance().ApplySettings(); | 809 | Core::System::GetInstance().ApplySettings(); |
| 810 | UpdateGPUAccuracyButton(); | ||
| 820 | }); | 811 | }); |
| 821 | multicore_status_button->setText(tr("MULTICORE")); | 812 | UpdateGPUAccuracyButton(); |
| 822 | multicore_status_button->setCheckable(true); | 813 | statusBar()->insertPermanentWidget(0, gpu_accuracy_button); |
| 823 | multicore_status_button->setChecked(Settings::values.use_multi_core.GetValue()); | ||
| 824 | |||
| 825 | statusBar()->insertPermanentWidget(0, multicore_status_button); | ||
| 826 | statusBar()->insertPermanentWidget(0, async_status_button); | ||
| 827 | 814 | ||
| 828 | // Setup Renderer API button | 815 | // Setup Renderer API button |
| 829 | renderer_status_button = new QPushButton(); | 816 | renderer_status_button = new QPushButton(); |
| @@ -1401,8 +1388,6 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t | |||
| 1401 | game_list_placeholder->hide(); | 1388 | game_list_placeholder->hide(); |
| 1402 | } | 1389 | } |
| 1403 | status_bar_update_timer.start(500); | 1390 | status_bar_update_timer.start(500); |
| 1404 | async_status_button->setDisabled(true); | ||
| 1405 | multicore_status_button->setDisabled(true); | ||
| 1406 | renderer_status_button->setDisabled(true); | 1391 | renderer_status_button->setDisabled(true); |
| 1407 | 1392 | ||
| 1408 | if (UISettings::values.hide_mouse || Settings::values.mouse_panning) { | 1393 | if (UISettings::values.hide_mouse || Settings::values.mouse_panning) { |
| @@ -1506,8 +1491,6 @@ void GMainWindow::ShutdownGame() { | |||
| 1506 | emu_speed_label->setVisible(false); | 1491 | emu_speed_label->setVisible(false); |
| 1507 | game_fps_label->setVisible(false); | 1492 | game_fps_label->setVisible(false); |
| 1508 | emu_frametime_label->setVisible(false); | 1493 | emu_frametime_label->setVisible(false); |
| 1509 | async_status_button->setEnabled(true); | ||
| 1510 | multicore_status_button->setEnabled(true); | ||
| 1511 | renderer_status_button->setEnabled(true); | 1494 | renderer_status_button->setEnabled(true); |
| 1512 | 1495 | ||
| 1513 | emulation_running = false; | 1496 | emulation_running = false; |
| @@ -2947,12 +2930,35 @@ void GMainWindow::UpdateStatusBar() { | |||
| 2947 | emu_frametime_label->setVisible(true); | 2930 | emu_frametime_label->setVisible(true); |
| 2948 | } | 2931 | } |
| 2949 | 2932 | ||
| 2933 | void GMainWindow::UpdateGPUAccuracyButton() { | ||
| 2934 | switch (Settings::values.gpu_accuracy.GetValue()) { | ||
| 2935 | case Settings::GPUAccuracy::Normal: { | ||
| 2936 | gpu_accuracy_button->setText(tr("GPU NORMAL")); | ||
| 2937 | gpu_accuracy_button->setChecked(false); | ||
| 2938 | break; | ||
| 2939 | } | ||
| 2940 | case Settings::GPUAccuracy::High: { | ||
| 2941 | gpu_accuracy_button->setText(tr("GPU HIGH")); | ||
| 2942 | gpu_accuracy_button->setChecked(true); | ||
| 2943 | break; | ||
| 2944 | } | ||
| 2945 | case Settings::GPUAccuracy::Extreme: { | ||
| 2946 | gpu_accuracy_button->setText(tr("GPU EXTREME")); | ||
| 2947 | gpu_accuracy_button->setChecked(true); | ||
| 2948 | break; | ||
| 2949 | } | ||
| 2950 | default: { | ||
| 2951 | gpu_accuracy_button->setText(tr("GPU ERROR")); | ||
| 2952 | gpu_accuracy_button->setChecked(true); | ||
| 2953 | } | ||
| 2954 | } | ||
| 2955 | } | ||
| 2956 | |||
| 2950 | void GMainWindow::UpdateStatusButtons() { | 2957 | void GMainWindow::UpdateStatusButtons() { |
| 2951 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); | 2958 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); |
| 2952 | multicore_status_button->setChecked(Settings::values.use_multi_core.GetValue()); | ||
| 2953 | async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 2954 | renderer_status_button->setChecked(Settings::values.renderer_backend.GetValue() == | 2959 | renderer_status_button->setChecked(Settings::values.renderer_backend.GetValue() == |
| 2955 | Settings::RendererBackend::Vulkan); | 2960 | Settings::RendererBackend::Vulkan); |
| 2961 | UpdateGPUAccuracyButton(); | ||
| 2956 | } | 2962 | } |
| 2957 | 2963 | ||
| 2958 | void GMainWindow::UpdateUISettings() { | 2964 | void GMainWindow::UpdateUISettings() { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 3eb6aed56..38e66ccd0 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -292,6 +292,7 @@ private: | |||
| 292 | void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {}, | 292 | void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {}, |
| 293 | std::string_view gpu_vendor = {}); | 293 | std::string_view gpu_vendor = {}); |
| 294 | void UpdateStatusBar(); | 294 | void UpdateStatusBar(); |
| 295 | void UpdateGPUAccuracyButton(); | ||
| 295 | void UpdateStatusButtons(); | 296 | void UpdateStatusButtons(); |
| 296 | void UpdateUISettings(); | 297 | void UpdateUISettings(); |
| 297 | void HideMouseCursor(); | 298 | void HideMouseCursor(); |
| @@ -317,8 +318,7 @@ private: | |||
| 317 | QLabel* emu_speed_label = nullptr; | 318 | QLabel* emu_speed_label = nullptr; |
| 318 | QLabel* game_fps_label = nullptr; | 319 | QLabel* game_fps_label = nullptr; |
| 319 | QLabel* emu_frametime_label = nullptr; | 320 | QLabel* emu_frametime_label = nullptr; |
| 320 | QPushButton* async_status_button = nullptr; | 321 | QPushButton* gpu_accuracy_button = nullptr; |
| 321 | QPushButton* multicore_status_button = nullptr; | ||
| 322 | QPushButton* renderer_status_button = nullptr; | 322 | QPushButton* renderer_status_button = nullptr; |
| 323 | QPushButton* dock_status_button = nullptr; | 323 | QPushButton* dock_status_button = nullptr; |
| 324 | QTimer status_bar_update_timer; | 324 | QTimer status_bar_update_timer; |