mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-25 15:20:31 -04:00
App settings revamp (#1139)
* WIP AppSetting overhaul * WIP migrating apps to new settings. * remove settings, rename tuned => target * formatting * Minor fixes * Fix hang on app load * run formatter * PR comment fixes * Load modulation into receiver model in app_settings * Run formatter --------- Co-authored-by: kallanreed <kallanreed@outlook.com>
This commit is contained in:
parent
f65e743c4c
commit
8bd3d6249d
105 changed files with 914 additions and 1136 deletions
|
@ -1362,14 +1362,21 @@ void ImageOptionsField::set_by_value(value_t v) {
|
|||
for (const auto& option : options) {
|
||||
if (option.second == v) {
|
||||
set_selected_index(new_index);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
new_index++;
|
||||
}
|
||||
|
||||
// No exact match was found, default to 0.
|
||||
set_selected_index(0);
|
||||
}
|
||||
|
||||
void ImageOptionsField::set_options(options_t new_options) {
|
||||
options = new_options;
|
||||
|
||||
// Set an invalid index to force on_change.
|
||||
selected_index_ = (size_t)-1;
|
||||
set_by_value(0);
|
||||
set_dirty();
|
||||
}
|
||||
|
@ -1440,19 +1447,25 @@ void OptionsField::set_selected_index(const size_t new_index, bool trigger_chang
|
|||
}
|
||||
|
||||
void OptionsField::set_by_value(value_t v) {
|
||||
size_t new_index{0};
|
||||
size_t new_index = 0;
|
||||
for (const auto& option : options) {
|
||||
if (option.second == v) {
|
||||
set_selected_index(new_index);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
new_index++;
|
||||
}
|
||||
|
||||
// No exact match was found, default to 0.
|
||||
set_selected_index(0);
|
||||
}
|
||||
|
||||
void OptionsField::set_options(options_t new_options) {
|
||||
options = new_options;
|
||||
set_by_value(0);
|
||||
|
||||
// Set an invalid index to force on_change.
|
||||
selected_index_ = (size_t)-1;
|
||||
set_selected_index(0);
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue