Added togglable graphics settings buttons in status bar
This commit is contained in:
22
dist/qt_themes/qdarkstyle/style.qss
vendored
22
dist/qt_themes/qdarkstyle/style.qss
vendored
@@ -1233,3 +1233,25 @@ QDateEdit::down-arrow:hover,
|
|||||||
QDateEdit::down-arrow:focus {
|
QDateEdit::down-arrow:focus {
|
||||||
image: url(:/qss_icons/rc/down_arrow.png);
|
image: url(:/qss_icons/rc/down_arrow.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPushButton#StatusButton,
|
||||||
|
QPushButton#StatusButton:disabled {
|
||||||
|
border: 1px solid;
|
||||||
|
color: #FFFFFF;
|
||||||
|
border-color: #FF6666;
|
||||||
|
background-color: transparent;
|
||||||
|
padding: 0px 3px 0px 3px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#StatusButton:hover {
|
||||||
|
border-color: #0000FF
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#StatusButton:checked {
|
||||||
|
border-color: #00FF00;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#StatusButton:hover:checked {
|
||||||
|
border-color: #0000FF;
|
||||||
|
}
|
||||||
|
|||||||
@@ -482,6 +482,37 @@ void GMainWindow::InitializeWidgets() {
|
|||||||
label->setContentsMargins(4, 0, 4, 0);
|
label->setContentsMargins(4, 0, 4, 0);
|
||||||
statusBar()->addPermanentWidget(label, 0);
|
statusBar()->addPermanentWidget(label, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async_status_button = new QPushButton();
|
||||||
|
async_status_button->setText(tr("ASYNC"));
|
||||||
|
async_status_button->setObjectName(tr("StatusButton"));
|
||||||
|
async_status_button->setCheckable(true);
|
||||||
|
async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation);
|
||||||
|
statusBar()->addPermanentWidget(async_status_button, 0);
|
||||||
|
|
||||||
|
accurate_status_button = new QPushButton();
|
||||||
|
accurate_status_button->setText(tr("ACCUR"));
|
||||||
|
accurate_status_button->setObjectName(tr("StatusButton"));
|
||||||
|
accurate_status_button->setCheckable(true);
|
||||||
|
accurate_status_button->setChecked(Settings::values.use_accurate_gpu_emulation);
|
||||||
|
statusBar()->addPermanentWidget(accurate_status_button, 0);
|
||||||
|
|
||||||
|
fps30_status_button = new QPushButton();
|
||||||
|
fps30_status_button->setText(tr("30FPS"));
|
||||||
|
fps30_status_button->setObjectName(tr("StatusButton"));
|
||||||
|
fps30_status_button->setCheckable(true);
|
||||||
|
fps30_status_button->setChecked(Settings::values.force_30fps_mode);
|
||||||
|
statusBar()->addPermanentWidget(fps30_status_button, 0);
|
||||||
|
|
||||||
|
renderer_status_button = new QPushButton();
|
||||||
|
renderer_status_button->setText(tr("OPENGL"));
|
||||||
|
renderer_status_button->setObjectName(tr("StatusButton"));
|
||||||
|
//renderer_status_button->setCheckable(true);
|
||||||
|
//renderer_status_button->setChecked(true);
|
||||||
|
renderer_status_button->setDisabled(true);
|
||||||
|
renderer_status_button->setStyleSheet(QStringLiteral("QPushButton:disabled{border-color: #0000FF;}"));
|
||||||
|
statusBar()->addPermanentWidget(renderer_status_button, 0);
|
||||||
|
|
||||||
statusBar()->setVisible(true);
|
statusBar()->setVisible(true);
|
||||||
setStyleSheet(QStringLiteral("QStatusBar::item{border: none;}"));
|
setStyleSheet(QStringLiteral("QStatusBar::item{border: none;}"));
|
||||||
}
|
}
|
||||||
@@ -717,6 +748,10 @@ void GMainWindow::ConnectWidgetEvents() {
|
|||||||
&GRenderWindow::OnEmulationStopping);
|
&GRenderWindow::OnEmulationStopping);
|
||||||
|
|
||||||
connect(&status_bar_update_timer, &QTimer::timeout, this, &GMainWindow::UpdateStatusBar);
|
connect(&status_bar_update_timer, &QTimer::timeout, this, &GMainWindow::UpdateStatusBar);
|
||||||
|
|
||||||
|
connect(async_status_button, &QPushButton::clicked, this, &GMainWindow::OnToggleASyncGPU);
|
||||||
|
connect(accurate_status_button, &QPushButton::clicked, this, &GMainWindow::OnToggleAccurateGPU);
|
||||||
|
connect(fps30_status_button, &QPushButton::clicked, this, &GMainWindow::OnToggle30FPSGPU);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::ConnectMenuEvents() {
|
void GMainWindow::ConnectMenuEvents() {
|
||||||
@@ -995,6 +1030,10 @@ void GMainWindow::BootGame(const QString& filename) {
|
|||||||
game_list_placeholder->hide();
|
game_list_placeholder->hide();
|
||||||
}
|
}
|
||||||
status_bar_update_timer.start(2000);
|
status_bar_update_timer.start(2000);
|
||||||
|
async_status_button->setDisabled(true);
|
||||||
|
accurate_status_button->setDisabled(true);
|
||||||
|
fps30_status_button->setDisabled(true);
|
||||||
|
renderer_status_button->setDisabled(true);
|
||||||
|
|
||||||
const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID();
|
const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID();
|
||||||
|
|
||||||
@@ -1064,6 +1103,9 @@ void GMainWindow::ShutdownGame() {
|
|||||||
emu_speed_label->setVisible(false);
|
emu_speed_label->setVisible(false);
|
||||||
game_fps_label->setVisible(false);
|
game_fps_label->setVisible(false);
|
||||||
emu_frametime_label->setVisible(false);
|
emu_frametime_label->setVisible(false);
|
||||||
|
async_status_button->setEnabled(true);
|
||||||
|
accurate_status_button->setEnabled(true);
|
||||||
|
fps30_status_button->setEnabled(true);
|
||||||
|
|
||||||
emulation_running = false;
|
emulation_running = false;
|
||||||
|
|
||||||
@@ -1831,6 +1873,10 @@ void GMainWindow::OnConfigure() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config->Save();
|
config->Save();
|
||||||
|
|
||||||
|
async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation);
|
||||||
|
accurate_status_button->setChecked(Settings::values.use_accurate_gpu_emulation);
|
||||||
|
fps30_status_button->setChecked(Settings::values.force_30fps_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::OnLoadAmiibo() {
|
void GMainWindow::OnLoadAmiibo() {
|
||||||
@@ -2108,6 +2154,37 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GMainWindow::OnToggleASyncGPU() {
|
||||||
|
if (emulation_running)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Settings::values.use_asynchronous_gpu_emulation =
|
||||||
|
!Settings::values.use_asynchronous_gpu_emulation;
|
||||||
|
async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation);
|
||||||
|
|
||||||
|
Settings::Apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GMainWindow::OnToggleAccurateGPU() {
|
||||||
|
if (emulation_running)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Settings::values.use_accurate_gpu_emulation = !Settings::values.use_accurate_gpu_emulation;
|
||||||
|
accurate_status_button->setChecked(Settings::values.use_accurate_gpu_emulation);
|
||||||
|
|
||||||
|
Settings::Apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GMainWindow::OnToggle30FPSGPU() {
|
||||||
|
if (emulation_running)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Settings::values.force_30fps_mode = !Settings::values.force_30fps_mode;
|
||||||
|
fps30_status_button->setChecked(Settings::values.force_30fps_mode);
|
||||||
|
|
||||||
|
Settings::Apply();
|
||||||
|
}
|
||||||
|
|
||||||
std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installed,
|
std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installed,
|
||||||
u64 program_id) {
|
u64 program_id) {
|
||||||
const auto dlc_entries =
|
const auto dlc_entries =
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class LoadingScreen;
|
|||||||
class MicroProfileDialog;
|
class MicroProfileDialog;
|
||||||
class ProfilerWidget;
|
class ProfilerWidget;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
class QPushButton;
|
||||||
class WaitTreeWidget;
|
class WaitTreeWidget;
|
||||||
enum class GameListOpenTarget;
|
enum class GameListOpenTarget;
|
||||||
class GameListPlaceholder;
|
class GameListPlaceholder;
|
||||||
@@ -215,6 +216,9 @@ private slots:
|
|||||||
void OnCaptureScreenshot();
|
void OnCaptureScreenshot();
|
||||||
void OnCoreError(Core::System::ResultStatus, std::string);
|
void OnCoreError(Core::System::ResultStatus, std::string);
|
||||||
void OnReinitializeKeys(ReinitializeKeyBehavior behavior);
|
void OnReinitializeKeys(ReinitializeKeyBehavior behavior);
|
||||||
|
void OnToggleASyncGPU();
|
||||||
|
void OnToggleAccurateGPU();
|
||||||
|
void OnToggle30FPSGPU();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id);
|
std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id);
|
||||||
@@ -236,6 +240,10 @@ private:
|
|||||||
QLabel* emu_speed_label = nullptr;
|
QLabel* emu_speed_label = nullptr;
|
||||||
QLabel* game_fps_label = nullptr;
|
QLabel* game_fps_label = nullptr;
|
||||||
QLabel* emu_frametime_label = nullptr;
|
QLabel* emu_frametime_label = nullptr;
|
||||||
|
QPushButton* async_status_button = nullptr;
|
||||||
|
QPushButton* accurate_status_button = nullptr;
|
||||||
|
QPushButton* fps30_status_button = nullptr;
|
||||||
|
QPushButton* renderer_status_button = nullptr;
|
||||||
QTimer status_bar_update_timer;
|
QTimer status_bar_update_timer;
|
||||||
|
|
||||||
std::unique_ptr<Config> config;
|
std::unique_ptr<Config> config;
|
||||||
|
|||||||
Reference in New Issue
Block a user