From 760c73a7beee4cda095a94d84303cba62ceaf253 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 22 Apr 2016 10:16:42 -0700 Subject: [PATCH] Move field.set_style()s after all participating widgets' styles are reset. --- firmware/application/analog_audio_app.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/firmware/application/analog_audio_app.cpp b/firmware/application/analog_audio_app.cpp index 7dd4c6d37..f6fd732ec 100644 --- a/firmware/application/analog_audio_app.cpp +++ b/firmware/application/analog_audio_app.cpp @@ -217,8 +217,6 @@ void AnalogAudioView::set_options_widget(std::unique_ptr new_widget) { } void AnalogAudioView::on_show_options_frequency() { - field_frequency.set_style(&style_options_group); - auto widget = std::make_unique(options_view_rect, &style_options_group); widget->set_step(receiver_model.frequency_step()); @@ -231,11 +229,10 @@ void AnalogAudioView::on_show_options_frequency() { }; set_options_widget(std::move(widget)); + field_frequency.set_style(&style_options_group); } void AnalogAudioView::on_show_options_rf_gain() { - field_lna.set_style(&style_options_group); - auto widget = std::make_unique(options_view_rect, &style_options_group); widget->set_rf_amp(receiver_model.rf_amp()); @@ -244,19 +241,20 @@ void AnalogAudioView::on_show_options_rf_gain() { }; set_options_widget(std::move(widget)); + field_lna.set_style(&style_options_group); } void AnalogAudioView::on_show_options_modulation() { const auto modulation = static_cast(receiver_model.modulation()); if( modulation == ReceiverModel::Mode::AMAudio ) { - options_modulation.set_style(&style_options_group); auto widget = std::make_unique(options_view_rect, &style_options_group); set_options_widget(std::move(widget)); + options_modulation.set_style(&style_options_group); } if( modulation == ReceiverModel::Mode::NarrowbandFMAudio ) { - options_modulation.set_style(&style_options_group); auto widget = std::make_unique(options_view_rect, &style_options_group); set_options_widget(std::move(widget)); + options_modulation.set_style(&style_options_group); } }