mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-15 01:45:46 -04:00
Consolidate frequency field on_edit (#1166)
This commit is contained in:
parent
7b669d7001
commit
5daa0dfbb1
36 changed files with 215 additions and 350 deletions
|
@ -56,22 +56,6 @@ AnalogTvView::AnalogTvView(
|
|||
&field_volume,
|
||||
&tv});
|
||||
|
||||
// Set on_change before initialising the field
|
||||
field_frequency.on_change = [this](rf::Frequency f) {
|
||||
this->on_target_frequency_changed(f);
|
||||
};
|
||||
|
||||
field_frequency.set_value(receiver_model.target_frequency());
|
||||
field_frequency.set_step(receiver_model.frequency_step());
|
||||
field_frequency.on_edit = [this, &nav]() {
|
||||
// TODO: Provide separate modal method/scheme?
|
||||
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.target_frequency());
|
||||
new_view->on_changed = [this](rf::Frequency f) {
|
||||
this->on_target_frequency_changed(f);
|
||||
this->field_frequency.set_value(f);
|
||||
};
|
||||
};
|
||||
|
||||
field_frequency.on_show_options = [this]() {
|
||||
this->on_show_options_frequency();
|
||||
};
|
||||
|
@ -125,10 +109,6 @@ void AnalogTvView::focus() {
|
|||
field_frequency.focus();
|
||||
}
|
||||
|
||||
void AnalogTvView::on_target_frequency_changed(rf::Frequency f) {
|
||||
receiver_model.set_target_frequency(f);
|
||||
}
|
||||
|
||||
void AnalogTvView::on_baseband_bandwidth_changed(uint32_t bandwidth_hz) {
|
||||
receiver_model.set_baseband_bandwidth(bandwidth_hz);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue