configure_per_game: Improve style consistency

The way the configurations are set up, it is not trivial to do this. I'll leave it as is, but the API selection, and the background color and volume slider selectors are kind of not following the style.
merge-requests/60/head
lat9nq 2020-07-13 23:25:14 +07:00
parent a350ae6be6
commit c94a8a3a43
3 changed files with 43 additions and 54 deletions

@ -87,7 +87,7 @@ void ConfigureGraphics::SetConfiguration() {
ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1);
ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal());
ConfigurationShared::SetHighlight(ui->aspect_ratio_layout, "aspect_ratio_layout",
ConfigurationShared::SetHighlight(ui->ar_label, "ar_label",
!Settings::values.aspect_ratio.UsingGlobal());
ConfigurationShared::SetHighlight(ui->bg_layout, "bg_layout",
!Settings::values.bg_red.UsingGlobal());
@ -263,8 +263,8 @@ void ConfigureGraphics::SetupPerGameUI() {
Settings::values.use_asynchronous_gpu_emulation,
ConfigurationShared::trackers.use_asynchronous_gpu_emulation);
ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->aspect_ratio_layout,
"aspect_ratio_layout",
ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->ar_label,
"ar_label",
Settings::values.aspect_ratio.GetValue(true));
ConfigurationShared::InsertGlobalItem(
ui->api, static_cast<int>(Settings::values.renderer_backend.GetValue(true)));

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<width>437</width>
<height>321</height>
</rect>
</property>
@ -24,7 +24,7 @@
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QWidget" name="api_layout" native="true">
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
@ -37,8 +37,16 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="api_label">
<property name="text">
<string>API:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="api">
<item>
@ -53,24 +61,15 @@
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>API:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="device"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="device_label">
<property name="text">
<string>Device:</string>
</property>
</widget>
</item>
</layout>
<item row="1" column="1">
<widget class="QComboBox" name="device"/>
</item>
</layout>
</widget>

@ -43,9 +43,9 @@ void ConfigureGraphicsAdvanced::SetConfiguration() {
ConfigurationShared::SetPerGameSetting(ui->gpu_accuracy, &Settings::values.gpu_accuracy);
ConfigurationShared::SetPerGameSetting(ui->anisotropic_filtering_combobox,
&Settings::values.max_anisotropy);
ConfigurationShared::SetHighlight(ui->gpu_accuracy_layout, "gpu_accuracy_layout",
ConfigurationShared::SetHighlight(ui->label_gpu_accuracy, "label_gpu_accuracy",
!Settings::values.gpu_accuracy.UsingGlobal());
ConfigurationShared::SetHighlight(ui->af_layout, "af_layout",
ConfigurationShared::SetHighlight(ui->af_label, "af_label",
!Settings::values.max_anisotropy.UsingGlobal());
}
}
@ -156,20 +156,10 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
ConfigurationShared::SetColoredTristate(ui->force_30fps_mode, "force_30fps_mode",
Settings::values.force_30fps_mode,
ConfigurationShared::trackers.force_30fps_mode);
ConfigurationShared::InsertGlobalItem(
ui->gpu_accuracy, static_cast<int>(Settings::values.gpu_accuracy.GetValue(true)));
ConfigurationShared::InsertGlobalItem(
ui->anisotropic_filtering_combobox,
ConfigurationShared::SetColoredComboBox(
ui->gpu_accuracy, ui->label_gpu_accuracy, "label_gpu_accuracy",
static_cast<int>(Settings::values.gpu_accuracy.GetValue(true)));
ConfigurationShared::SetColoredComboBox(
ui->anisotropic_filtering_combobox, ui->af_label, "af_label",
static_cast<int>(Settings::values.max_anisotropy.GetValue(true)));
connect(ui->gpu_accuracy, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this,
[this](int index) {
ConfigurationShared::SetHighlight(ui->gpu_accuracy_layout, "gpu_accuracy_layout",
index != 0);
});
connect(ui->anisotropic_filtering_combobox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, [this](int index) {
ConfigurationShared::SetHighlight(ui->af_layout, "af_layout", index != 0);
});
}