mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-06-03 07:48:22 +00:00
Fix Cancel button in Settings->Autostart (#2087)
This commit is contained in:
parent
689224fd8d
commit
a602abf1d8
@ -840,7 +840,8 @@ void SetMenuColorView::focus() {
|
|||||||
button_save.focus();
|
button_save.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SetAutostartView*/
|
/* SetAutoStartView ************************************/
|
||||||
|
|
||||||
SetAutostartView::SetAutostartView(NavigationView& nav) {
|
SetAutostartView::SetAutostartView(NavigationView& nav) {
|
||||||
add_children({&labels,
|
add_children({&labels,
|
||||||
&button_save,
|
&button_save,
|
||||||
@ -848,7 +849,12 @@ SetAutostartView::SetAutostartView(NavigationView& nav) {
|
|||||||
&options});
|
&options});
|
||||||
|
|
||||||
button_save.on_select = [&nav, this](Button&) {
|
button_save.on_select = [&nav, this](Button&) {
|
||||||
nav_setting.save();
|
autostart_app = "";
|
||||||
|
if (selected != 0) {
|
||||||
|
auto it = full_app_list.find(selected);
|
||||||
|
if (it != full_app_list.end())
|
||||||
|
autostart_app = it->second;
|
||||||
|
}
|
||||||
nav.pop();
|
nav.pop();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -879,14 +885,7 @@ SetAutostartView::SetAutostartView(NavigationView& nav) {
|
|||||||
|
|
||||||
options.set_options(opts);
|
options.set_options(opts);
|
||||||
options.on_change = [this](size_t, OptionsField::value_t v) {
|
options.on_change = [this](size_t, OptionsField::value_t v) {
|
||||||
if (v == 0) {
|
selected = v;
|
||||||
autostart_app = "";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto it = full_app_list.find(v);
|
|
||||||
if (it != full_app_list.end()) {
|
|
||||||
autostart_app = it->second;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
options.set_selected_index(selected);
|
options.set_selected_index(selected);
|
||||||
}
|
}
|
||||||
|
@ -817,14 +817,15 @@ class SetAutostartView : public View {
|
|||||||
"nav"sv,
|
"nav"sv,
|
||||||
{{"autostart_app"sv, &autostart_app}}};
|
{{"autostart_app"sv, &autostart_app}}};
|
||||||
Labels labels{
|
Labels labels{
|
||||||
{{1 * 8, 1 * 16}, "Select app to start on boot", Color::light_grey()}};
|
{{1 * 8, 1 * 16}, "Select app to start on boot", Color::light_grey()},
|
||||||
|
{{2 * 8, 2 * 16}, "(an SD Card is required)", Color::light_grey()}};
|
||||||
|
|
||||||
Button button_save{
|
Button button_save{
|
||||||
{2 * 8, 16 * 16, 12 * 8, 32},
|
{2 * 8, 16 * 16, 12 * 8, 32},
|
||||||
"Save"};
|
"Save"};
|
||||||
|
|
||||||
OptionsField options{
|
OptionsField options{
|
||||||
{0 * 8, 3 * 16},
|
{8 * 8, 4 * 16},
|
||||||
30,
|
30,
|
||||||
{}};
|
{}};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user