From b47a5fe0c8539dc8085a316726d981f3dc44c80c Mon Sep 17 00:00:00 2001 From: sommermorgentraum <24917424+zxkmm@users.noreply.github.com> Date: Sat, 28 Dec 2024 05:04:11 +0800 Subject: [PATCH] Add + - buttons in Encoder dial settings (#2447) --- firmware/application/apps/ui_settings.cpp | 19 ++++++++++++++++++- firmware/application/apps/ui_settings.hpp | 16 ++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/firmware/application/apps/ui_settings.cpp b/firmware/application/apps/ui_settings.cpp index 50b45a5d..be855bf5 100644 --- a/firmware/application/apps/ui_settings.cpp +++ b/firmware/application/apps/ui_settings.cpp @@ -707,11 +707,28 @@ SetEncoderDialView::SetEncoderDialView(NavigationView& nav) { &field_encoder_dial_sensitivity, &field_encoder_rate_multiplier, &button_save, - &button_cancel}); + &button_cancel, + &button_dial_sensitivity_plus, + &button_dial_sensitivity_minus, + &button_rate_multiplier_plus, + &button_rate_multiplier_minus}); field_encoder_dial_sensitivity.set_by_value(pmem::encoder_dial_sensitivity()); field_encoder_rate_multiplier.set_value(pmem::encoder_rate_multiplier()); + button_dial_sensitivity_plus.on_select = [this](Button&) { + field_encoder_dial_sensitivity.on_encoder(1); + }; + button_dial_sensitivity_minus.on_select = [this](Button&) { + field_encoder_dial_sensitivity.on_encoder(-1); + }; + button_rate_multiplier_plus.on_select = [this](Button&) { + field_encoder_rate_multiplier.on_encoder(1); + }; + button_rate_multiplier_minus.on_select = [this](Button&) { + field_encoder_rate_multiplier.on_encoder(-1); + }; + button_save.on_select = [&nav, this](Button&) { pmem::set_encoder_dial_sensitivity(field_encoder_dial_sensitivity.selected_index_value()); pmem::set_encoder_rate_multiplier(field_encoder_rate_multiplier.value()); diff --git a/firmware/application/apps/ui_settings.hpp b/firmware/application/apps/ui_settings.hpp index d9a244bf..e7641010 100644 --- a/firmware/application/apps/ui_settings.hpp +++ b/firmware/application/apps/ui_settings.hpp @@ -611,6 +611,22 @@ class SetEncoderDialView : public View { 1, ' '}; + Button button_dial_sensitivity_plus{ + {20 * 8, 4 * 16, 16, 16}, + "+"}; + + Button button_dial_sensitivity_minus{ + {20 * 8, 6 * 16, 16, 16}, + "-"}; + + Button button_rate_multiplier_plus{ + {20 * 8, 11 * 16, 16, 16}, + "+"}; + + Button button_rate_multiplier_minus{ + {20 * 8, 13 * 16, 16, 16}, + "-"}; + Button button_save{ {2 * 8, 16 * 16, 12 * 8, 32}, "Save"};