mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 15:01:28 +12:00
stylesheets: make UI Colors optional
This commit is contained in:
parent
e6a07e80d7
commit
fff62df6a2
8 changed files with 99 additions and 27 deletions
|
@ -669,6 +669,8 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> xSettings, const
|
|||
|
||||
ui->cb_show_welcome->setToolTip(json_emu_gui["show_welcome"].toString());
|
||||
|
||||
ui->cb_custom_colors->setToolTip(json_emu_gui["custom_colors"].toString());
|
||||
|
||||
xemu_settings->EnhanceCheckBox(ui->exitOnStop, emu_settings::ExitRPCS3OnFinish);
|
||||
ui->exitOnStop->setToolTip(json_emu_misc["exitOnStop"].toString());
|
||||
|
||||
|
@ -691,6 +693,13 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> xSettings, const
|
|||
{
|
||||
ui->cb_show_welcome->setChecked(xgui_settings->GetValue(GUI::ib_show_welcome).toBool());
|
||||
|
||||
bool enableUIColors = xgui_settings->GetValue(GUI::m_enableUIColors).toBool();
|
||||
ui->cb_custom_colors->setChecked(enableUIColors);
|
||||
ui->pb_gl_icon_color->setEnabled(enableUIColors);
|
||||
ui->pb_gl_tool_icon_color->setEnabled(enableUIColors);
|
||||
ui->pb_tool_bar_color->setEnabled(enableUIColors);
|
||||
ui->pb_tool_icon_color->setEnabled(enableUIColors);
|
||||
|
||||
connect(ui->okButton, &QAbstractButton::clicked, [this]() {
|
||||
// Only attempt to load a config if changes occurred.
|
||||
if (m_startingConfig != xgui_settings->GetValue(GUI::m_currentConfig).toString())
|
||||
|
@ -707,8 +716,8 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> xSettings, const
|
|||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
|
||||
{
|
||||
xgui_settings->Reset(true);
|
||||
xgui_settings->ChangeToConfig(tr("default"));
|
||||
Q_EMIT GuiStylesheetRequest(tr("default"));
|
||||
xgui_settings->ChangeToConfig(GUI::Default);
|
||||
Q_EMIT GuiStylesheetRequest(GUI::Default);
|
||||
Q_EMIT GuiSettingsSyncRequest();
|
||||
AddConfigs();
|
||||
AddStylesheets();
|
||||
|
@ -719,6 +728,13 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> xSettings, const
|
|||
connect(ui->pb_apply_stylesheet, &QAbstractButton::clicked, this, &settings_dialog::OnApplyStylesheet);
|
||||
connect(ui->pb_open_folder, &QAbstractButton::clicked, [=]() {QDesktopServices::openUrl(xgui_settings->GetSettingsDir()); });
|
||||
connect(ui->cb_show_welcome, &QCheckBox::clicked, [=](bool val) {xgui_settings->SetValue(GUI::ib_show_welcome, val); });
|
||||
connect(ui->cb_custom_colors, &QCheckBox::clicked, [=](bool val) {
|
||||
xgui_settings->SetValue(GUI::m_enableUIColors, val);
|
||||
ui->pb_gl_icon_color->setEnabled(val);
|
||||
ui->pb_gl_tool_icon_color->setEnabled(val);
|
||||
ui->pb_tool_bar_color->setEnabled(val);
|
||||
ui->pb_tool_icon_color->setEnabled(val);
|
||||
});
|
||||
auto colorDialog = [&](const GUI_SAVE& color, const QString& title, QPushButton *button){
|
||||
QColor oldColor = xgui_settings->GetValue(color).value<QColor>();
|
||||
QColorDialog dlg(oldColor, this);
|
||||
|
@ -858,11 +874,11 @@ void settings_dialog::AddConfigs()
|
|||
{
|
||||
ui->combo_configs->clear();
|
||||
|
||||
ui->combo_configs->addItem(tr("default"));
|
||||
ui->combo_configs->addItem(GUI::Default);
|
||||
|
||||
for (QString entry : xgui_settings->GetConfigEntries())
|
||||
{
|
||||
if (entry != tr("default"))
|
||||
if (entry != GUI::Default)
|
||||
{
|
||||
ui->combo_configs->addItem(entry);
|
||||
}
|
||||
|
@ -886,20 +902,19 @@ void settings_dialog::AddStylesheets()
|
|||
{
|
||||
ui->combo_stylesheets->clear();
|
||||
|
||||
ui->combo_stylesheets->addItem(tr("default"));
|
||||
ui->combo_stylesheets->addItem(GUI::Default);
|
||||
|
||||
for (QString entry : xgui_settings->GetStylesheetEntries())
|
||||
{
|
||||
if (entry != tr("default"))
|
||||
if (entry != GUI::Default)
|
||||
{
|
||||
ui->combo_stylesheets->addItem(entry);
|
||||
}
|
||||
}
|
||||
|
||||
QString currentSelection = xgui_settings->GetValue(GUI::m_currentStylesheet).toString();
|
||||
m_startingStylesheet = currentSelection;
|
||||
m_startingStylesheet = xgui_settings->GetValue(GUI::m_currentStylesheet).toString();
|
||||
|
||||
int index = ui->combo_stylesheets->findText(currentSelection);
|
||||
int index = ui->combo_stylesheets->findText(m_startingStylesheet);
|
||||
if (index != -1)
|
||||
{
|
||||
ui->combo_stylesheets->setCurrentIndex(index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue