diff options
| author | 2020-07-13 21:32:10 -0400 | |
|---|---|---|
| committer | 2020-07-19 13:26:55 -0400 | |
| commit | c4246b80f84c0bd979e4506c17b1c9a34ac77ae8 (patch) | |
| tree | 680b8e71387c8f17ef80d88ef4ae43e192137c3c /src | |
| parent | configure_audio: Implement highlighted overrides (diff) | |
| download | yuzu-c4246b80f84c0bd979e4506c17b1c9a34ac77ae8.tar.gz yuzu-c4246b80f84c0bd979e4506c17b1c9a34ac77ae8.tar.xz yuzu-c4246b80f84c0bd979e4506c17b1c9a34ac77ae8.zip | |
configure_graphics: Implement highlighted overrides
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 45 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 289 |
2 files changed, 200 insertions, 134 deletions
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index cb4706bd6..07dc75ccb 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -32,7 +32,12 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) | |||
| 32 | SetConfiguration(); | 32 | SetConfiguration(); |
| 33 | 33 | ||
| 34 | connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, | 34 | connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, |
| 35 | [this] { UpdateDeviceComboBox(); }); | 35 | [this] { |
| 36 | UpdateDeviceComboBox(); | ||
| 37 | if (!Settings::configuring_global) { | ||
| 38 | ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", ui->api->currentIndex() != ConfigurationShared::USE_GLOBAL_INDEX); | ||
| 39 | } | ||
| 40 | }); | ||
| 36 | connect(ui->device, qOverload<int>(&QComboBox::activated), this, | 41 | connect(ui->device, qOverload<int>(&QComboBox::activated), this, |
| 37 | [this](int device) { UpdateDeviceSelection(device); }); | 42 | [this](int device) { UpdateDeviceSelection(device); }); |
| 38 | 43 | ||
| @@ -65,25 +70,23 @@ void ConfigureGraphics::SetConfiguration() { | |||
| 65 | ui->api->setEnabled(runtime_lock); | 70 | ui->api->setEnabled(runtime_lock); |
| 66 | ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock); | 71 | ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock); |
| 67 | ui->use_disk_shader_cache->setEnabled(runtime_lock); | 72 | ui->use_disk_shader_cache->setEnabled(runtime_lock); |
| 73 | ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache.GetValue()); | ||
| 74 | ui->use_asynchronous_gpu_emulation->setChecked( | ||
| 75 | Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 68 | 76 | ||
| 69 | if (Settings::configuring_global) { | 77 | if (Settings::configuring_global) { |
| 70 | ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue())); | 78 | ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue())); |
| 71 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); | 79 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); |
| 72 | ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache.GetValue()); | ||
| 73 | ui->use_asynchronous_gpu_emulation->setChecked( | ||
| 74 | Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 75 | } else { | 80 | } else { |
| 76 | ConfigurationShared::SetPerGameSetting(ui->use_disk_shader_cache, | ||
| 77 | &Settings::values.use_disk_shader_cache); | ||
| 78 | ConfigurationShared::SetPerGameSetting(ui->use_asynchronous_gpu_emulation, | ||
| 79 | &Settings::values.use_asynchronous_gpu_emulation); | ||
| 80 | |||
| 81 | ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); | 81 | ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); |
| 82 | ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox, | 82 | ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox, |
| 83 | &Settings::values.aspect_ratio); | 83 | &Settings::values.aspect_ratio); |
| 84 | 84 | ||
| 85 | ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); | 85 | ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); |
| 86 | ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); | 86 | ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); |
| 87 | ConfigurationShared::SetHighlight(ui->aspect_ratio_layout, "aspect_ratio_layout", !Settings::values.aspect_ratio.UsingGlobal()); | ||
| 88 | ConfigurationShared::SetHighlight(ui->bg_layout, "bg_layout", !Settings::values.bg_red.UsingGlobal()); | ||
| 89 | // FIXME: ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", !Settings::values.renderer_backend.UsingGlobal()); | ||
| 87 | } | 90 | } |
| 88 | 91 | ||
| 89 | UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red.GetValue(), | 92 | UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red.GetValue(), |
| @@ -240,11 +243,23 @@ void ConfigureGraphics::SetupPerGameUI() { | |||
| 240 | return; | 243 | return; |
| 241 | } | 244 | } |
| 242 | 245 | ||
| 246 | connect(ui->aspect_ratio_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, [this](int index) { | ||
| 247 | ConfigurationShared::SetHighlight(ui->aspect_ratio_layout, "aspect_ratio_layout", index != 0); | ||
| 248 | }); | ||
| 243 | connect(ui->bg_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, | 249 | connect(ui->bg_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, |
| 244 | [this](int index) { ui->bg_button->setEnabled(index == 1); }); | 250 | [this](int index) { |
| 245 | 251 | ui->bg_button->setEnabled(index == 1); | |
| 246 | ui->use_disk_shader_cache->setTristate(true); | 252 | ConfigurationShared::SetHighlight(ui->bg_layout, "bg_layout", index == 1); |
| 247 | ui->use_asynchronous_gpu_emulation->setTristate(true); | 253 | }); |
| 248 | ConfigurationShared::InsertGlobalItem(ui->aspect_ratio_combobox); | 254 | |
| 249 | ConfigurationShared::InsertGlobalItem(ui->api); | 255 | ConfigurationShared::SetColoredTristate(ui->use_disk_shader_cache, "use_disk_shader_cache", |
| 256 | Settings::values.use_disk_shader_cache, | ||
| 257 | ConfigurationShared::trackers.use_disk_shader_cache); | ||
| 258 | ConfigurationShared::SetColoredTristate( | ||
| 259 | ui->use_asynchronous_gpu_emulation, "use_asynchronous_gpu_emulation", | ||
| 260 | Settings::values.use_asynchronous_gpu_emulation, | ||
| 261 | ConfigurationShared::trackers.use_asynchronous_gpu_emulation); | ||
| 262 | |||
| 263 | ConfigurationShared::InsertGlobalItem(ui->aspect_ratio_combobox, ui->aspect_ratio_combobox->itemText(Settings::values.aspect_ratio.GetValue(true))); | ||
| 264 | ConfigurationShared::InsertGlobalItem(ui->api, ui->api->itemText(static_cast<int>(Settings::values.renderer_backend.GetValue(true)))); | ||
| 250 | } | 265 | } |
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index 62418fc14..6164569fe 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui | |||
| @@ -23,43 +23,57 @@ | |||
| 23 | </property> | 23 | </property> |
| 24 | <layout class="QVBoxLayout" name="verticalLayout_3"> | 24 | <layout class="QVBoxLayout" name="verticalLayout_3"> |
| 25 | <item> | 25 | <item> |
| 26 | <layout class="QHBoxLayout" name="horizontalLayout_4"> | 26 | <widget class="QWidget" name="api_layout" native="true"> |
| 27 | <item> | 27 | <layout class="QVBoxLayout" name="verticalLayout_5"> |
| 28 | <widget class="QLabel" name="label_2"> | 28 | <property name="leftMargin"> |
| 29 | <property name="text"> | 29 | <number>0</number> |
| 30 | <string>API:</string> | 30 | </property> |
| 31 | </property> | 31 | <property name="topMargin"> |
| 32 | </widget> | 32 | <number>0</number> |
| 33 | </item> | 33 | </property> |
| 34 | <item> | 34 | <property name="rightMargin"> |
| 35 | <widget class="QComboBox" name="api"> | 35 | <number>0</number> |
| 36 | <item> | 36 | </property> |
| 37 | <property name="text"> | 37 | <property name="bottomMargin"> |
| 38 | <string notr="true">OpenGL</string> | 38 | <number>0</number> |
| 39 | </property> | 39 | </property> |
| 40 | </item> | 40 | <item> |
| 41 | <item> | 41 | <layout class="QGridLayout" name="gridLayout"> |
| 42 | <property name="text"> | 42 | <item row="0" column="1"> |
| 43 | <string notr="true">Vulkan</string> | 43 | <widget class="QComboBox" name="api"> |
| 44 | </property> | 44 | <item> |
| 45 | </item> | 45 | <property name="text"> |
| 46 | </widget> | 46 | <string notr="true">OpenGL</string> |
| 47 | </item> | 47 | </property> |
| 48 | </layout> | 48 | </item> |
| 49 | </item> | 49 | <item> |
| 50 | <item> | 50 | <property name="text"> |
| 51 | <layout class="QHBoxLayout" name="horizontalLayout_5"> | 51 | <string notr="true">Vulkan</string> |
| 52 | <item> | 52 | </property> |
| 53 | <widget class="QLabel" name="label_3"> | 53 | </item> |
| 54 | <property name="text"> | 54 | </widget> |
| 55 | <string>Device:</string> | 55 | </item> |
| 56 | </property> | 56 | <item row="0" column="0"> |
| 57 | </widget> | 57 | <widget class="QLabel" name="label_2"> |
| 58 | </item> | 58 | <property name="text"> |
| 59 | <item> | 59 | <string>API:</string> |
| 60 | <widget class="QComboBox" name="device"/> | 60 | </property> |
| 61 | </item> | 61 | </widget> |
| 62 | </layout> | 62 | </item> |
| 63 | <item row="1" column="1"> | ||
| 64 | <widget class="QComboBox" name="device"/> | ||
| 65 | </item> | ||
| 66 | <item row="1" column="0"> | ||
| 67 | <widget class="QLabel" name="label_3"> | ||
| 68 | <property name="text"> | ||
| 69 | <string>Device:</string> | ||
| 70 | </property> | ||
| 71 | </widget> | ||
| 72 | </item> | ||
| 73 | </layout> | ||
| 74 | </item> | ||
| 75 | </layout> | ||
| 76 | </widget> | ||
| 63 | </item> | 77 | </item> |
| 64 | </layout> | 78 | </layout> |
| 65 | </widget> | 79 | </widget> |
| @@ -85,96 +99,133 @@ | |||
| 85 | </widget> | 99 | </widget> |
| 86 | </item> | 100 | </item> |
| 87 | <item> | 101 | <item> |
| 88 | <layout class="QHBoxLayout" name="horizontalLayout_6"> | 102 | <widget class="QWidget" name="aspect_ratio_layout" native="true"> |
| 89 | <item> | 103 | <layout class="QHBoxLayout" name="horizontalLayout_6"> |
| 90 | <widget class="QLabel" name="ar_label"> | 104 | <property name="leftMargin"> |
| 91 | <property name="text"> | 105 | <number>0</number> |
| 92 | <string>Aspect Ratio:</string> | 106 | </property> |
| 93 | </property> | 107 | <property name="topMargin"> |
| 94 | </widget> | 108 | <number>0</number> |
| 95 | </item> | 109 | </property> |
| 96 | <item> | 110 | <property name="rightMargin"> |
| 97 | <widget class="QComboBox" name="aspect_ratio_combobox"> | 111 | <number>0</number> |
| 98 | <item> | 112 | </property> |
| 99 | <property name="text"> | 113 | <property name="bottomMargin"> |
| 100 | <string>Default (16:9)</string> | 114 | <number>0</number> |
| 101 | </property> | 115 | </property> |
| 102 | </item> | 116 | <item> |
| 103 | <item> | 117 | <widget class="QLabel" name="ar_label"> |
| 104 | <property name="text"> | ||
| 105 | <string>Force 4:3</string> | ||
| 106 | </property> | ||
| 107 | </item> | ||
| 108 | <item> | ||
| 109 | <property name="text"> | 118 | <property name="text"> |
| 110 | <string>Force 21:9</string> | 119 | <string>Aspect Ratio:</string> |
| 111 | </property> | 120 | </property> |
| 112 | </item> | 121 | </widget> |
| 113 | <item> | 122 | </item> |
| 114 | <property name="text"> | 123 | <item> |
| 115 | <string>Stretch to Window</string> | 124 | <widget class="QComboBox" name="aspect_ratio_combobox"> |
| 116 | </property> | 125 | <item> |
| 117 | </item> | 126 | <property name="text"> |
| 118 | </widget> | 127 | <string>Default (16:9)</string> |
| 119 | </item> | 128 | </property> |
| 120 | </layout> | 129 | </item> |
| 130 | <item> | ||
| 131 | <property name="text"> | ||
| 132 | <string>Force 4:3</string> | ||
| 133 | </property> | ||
| 134 | </item> | ||
| 135 | <item> | ||
| 136 | <property name="text"> | ||
| 137 | <string>Force 21:9</string> | ||
| 138 | </property> | ||
| 139 | </item> | ||
| 140 | <item> | ||
| 141 | <property name="text"> | ||
| 142 | <string>Stretch to Window</string> | ||
| 143 | </property> | ||
| 144 | </item> | ||
| 145 | </widget> | ||
| 146 | </item> | ||
| 147 | </layout> | ||
| 148 | </widget> | ||
| 121 | </item> | 149 | </item> |
| 122 | <item> | 150 | <item> |
| 123 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | 151 | <widget class="QWidget" name="bg_layout" native="true"> |
| 124 | <item> | 152 | <property name="sizePolicy"> |
| 125 | <widget class="QComboBox" name="bg_combobox"> | 153 | <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> |
| 126 | <property name="currentText"> | 154 | <horstretch>0</horstretch> |
| 127 | <string>Use global background color</string> | 155 | <verstretch>0</verstretch> |
| 128 | </property> | 156 | </sizepolicy> |
| 129 | <property name="currentIndex"> | 157 | </property> |
| 130 | <number>0</number> | 158 | <layout class="QHBoxLayout" name="horizontalLayout_3"> |
| 131 | </property> | 159 | <property name="spacing"> |
| 132 | <property name="maxVisibleItems"> | 160 | <number>6</number> |
| 133 | <number>10</number> | 161 | </property> |
| 134 | </property> | 162 | <property name="leftMargin"> |
| 135 | <item> | 163 | <number>0</number> |
| 136 | <property name="text"> | 164 | </property> |
| 165 | <property name="topMargin"> | ||
| 166 | <number>0</number> | ||
| 167 | </property> | ||
| 168 | <property name="rightMargin"> | ||
| 169 | <number>0</number> | ||
| 170 | </property> | ||
| 171 | <property name="bottomMargin"> | ||
| 172 | <number>0</number> | ||
| 173 | </property> | ||
| 174 | <item> | ||
| 175 | <widget class="QComboBox" name="bg_combobox"> | ||
| 176 | <property name="currentText"> | ||
| 137 | <string>Use global background color</string> | 177 | <string>Use global background color</string> |
| 138 | </property> | 178 | </property> |
| 139 | </item> | 179 | <property name="currentIndex"> |
| 140 | <item> | 180 | <number>0</number> |
| 181 | </property> | ||
| 182 | <property name="maxVisibleItems"> | ||
| 183 | <number>10</number> | ||
| 184 | </property> | ||
| 185 | <item> | ||
| 186 | <property name="text"> | ||
| 187 | <string>Use global background color</string> | ||
| 188 | </property> | ||
| 189 | </item> | ||
| 190 | <item> | ||
| 191 | <property name="text"> | ||
| 192 | <string>Set background color:</string> | ||
| 193 | </property> | ||
| 194 | </item> | ||
| 195 | </widget> | ||
| 196 | </item> | ||
| 197 | <item> | ||
| 198 | <widget class="QLabel" name="bg_label"> | ||
| 141 | <property name="text"> | 199 | <property name="text"> |
| 142 | <string>Set background color:</string> | 200 | <string>Background Color:</string> |
| 201 | </property> | ||
| 202 | </widget> | ||
| 203 | </item> | ||
| 204 | <item> | ||
| 205 | <spacer name="horizontalSpacer"> | ||
| 206 | <property name="orientation"> | ||
| 207 | <enum>Qt::Horizontal</enum> | ||
| 208 | </property> | ||
| 209 | <property name="sizeHint" stdset="0"> | ||
| 210 | <size> | ||
| 211 | <width>40</width> | ||
| 212 | <height>20</height> | ||
| 213 | </size> | ||
| 143 | </property> | 214 | </property> |
| 144 | </item> | 215 | </spacer> |
| 145 | </widget> | 216 | </item> |
| 146 | </item> | 217 | <item> |
| 147 | <item> | 218 | <widget class="QPushButton" name="bg_button"> |
| 148 | <widget class="QLabel" name="bg_label"> | 219 | <property name="maximumSize"> |
| 149 | <property name="text"> | 220 | <size> |
| 150 | <string>Background Color:</string> | 221 | <width>40</width> |
| 151 | </property> | 222 | <height>16777215</height> |
| 152 | </widget> | 223 | </size> |
| 153 | </item> | 224 | </property> |
| 154 | <item> | 225 | </widget> |
| 155 | <spacer name="horizontalSpacer"> | 226 | </item> |
| 156 | <property name="orientation"> | 227 | </layout> |
| 157 | <enum>Qt::Horizontal</enum> | 228 | </widget> |
| 158 | </property> | ||
| 159 | <property name="sizeHint" stdset="0"> | ||
| 160 | <size> | ||
| 161 | <width>40</width> | ||
| 162 | <height>20</height> | ||
| 163 | </size> | ||
| 164 | </property> | ||
| 165 | </spacer> | ||
| 166 | </item> | ||
| 167 | <item> | ||
| 168 | <widget class="QPushButton" name="bg_button"> | ||
| 169 | <property name="maximumSize"> | ||
| 170 | <size> | ||
| 171 | <width>40</width> | ||
| 172 | <height>16777215</height> | ||
| 173 | </size> | ||
| 174 | </property> | ||
| 175 | </widget> | ||
| 176 | </item> | ||
| 177 | </layout> | ||
| 178 | </item> | 229 | </item> |
| 179 | </layout> | 230 | </layout> |
| 180 | </widget> | 231 | </widget> |