mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-23 09:45:46 +00:00
configuration: Use specialization of settings
Reduces some ugliness in frontend code.
This commit is contained in:
parent
b2438f1fb7
commit
21723879e7
4 changed files with 36 additions and 18 deletions
|
@ -44,18 +44,12 @@ void ConfigureAudio::Setup(const ConfigurationShared::Builder& builder) {
|
|||
|
||||
for (auto* setting : settings) {
|
||||
auto* widget = [&]() {
|
||||
// TODO (lat9nq): Let the system manage sink_id
|
||||
if (setting->Id() == Settings::values.volume.Id()) {
|
||||
// volume needs to be a slider (default is line edit)
|
||||
return builder.BuildWidget(setting, apply_funcs, nullptr,
|
||||
ConfigurationShared::RequestType::Slider,
|
||||
tr("%1%", "Volume percentage (e.g. 50%)"));
|
||||
} else if (setting->Id() == Settings::values.audio_output_device_id.Id() ||
|
||||
setting->Id() == Settings::values.audio_input_device_id.Id() ||
|
||||
setting->Id() == Settings::values.sink_id.Id()) {
|
||||
// These need to be unmanaged comboboxes, so we can populate them ourselves
|
||||
// TODO (lat9nq): Let it manage sink_id
|
||||
return builder.BuildWidget(setting, apply_funcs,
|
||||
ConfigurationShared::RequestType::ComboBox, false);
|
||||
} else {
|
||||
return builder.BuildWidget(setting, apply_funcs);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue