Move field.set_style()s after all participating widgets' styles are reset.

This commit is contained in:
Jared Boone 2016-04-22 10:16:42 -07:00
parent c650536934
commit 760c73a7be

View File

@ -217,8 +217,6 @@ void AnalogAudioView::set_options_widget(std::unique_ptr<Widget> new_widget) {
}
void AnalogAudioView::on_show_options_frequency() {
field_frequency.set_style(&style_options_group);
auto widget = std::make_unique<FrequencyOptionsView>(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<RadioGainOptionsView>(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<ReceiverModel::Mode>(receiver_model.modulation());
if( modulation == ReceiverModel::Mode::AMAudio ) {
options_modulation.set_style(&style_options_group);
auto widget = std::make_unique<AMOptionsView>(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<NBFMOptionsView>(options_view_rect, &style_options_group);
set_options_widget(std::move(widget));
options_modulation.set_style(&style_options_group);
}
}