Freq field tweaks (#1306)

* UX improvements

* Prevent wrapping
This commit is contained in:
Kyle Reed 2023-07-25 06:06:13 -07:00 committed by GitHub
parent ea238f4988
commit 195a6224a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 65 additions and 15 deletions

View file

@ -52,6 +52,7 @@ class FrequencyField : public Widget {
void set_value(rf::Frequency new_value);
void set_step(rf::Frequency new_value);
void set_allow_digit_mode(bool allowed);
void paint(Painter& painter) override;
@ -71,11 +72,15 @@ class FrequencyField : public Widget {
uint8_t digit_{3};
bool digit_mode_{false};
bool allow_digit_mode_{true};
SwitchesState initial_switch_config_{};
/* Gets the step value for the given digit when in digit_mode. */
rf::Frequency digit_step() const;
rf::Frequency clamp_value(rf::Frequency value);
void enable_switch_config();
void reset_switch_config();
};
template <size_t N>