mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-04-15 22:11:27 +00:00
Factor out a common rectangle.
This commit is contained in:
parent
0c29308eb9
commit
c12833a288
@ -216,10 +216,7 @@ void AnalogAudioView::on_show_options_frequency() {
|
|||||||
|
|
||||||
field_frequency.set_style(&style_options_group);
|
field_frequency.set_style(&style_options_group);
|
||||||
|
|
||||||
auto widget = std::make_unique<FrequencyOptionsView>(
|
auto widget = std::make_unique<FrequencyOptionsView>(options_view_rect, &style_options_group);
|
||||||
Rect { 0 * 8, 1 * 16, 30 * 8, 1 * 16 },
|
|
||||||
&style_options_group
|
|
||||||
);
|
|
||||||
|
|
||||||
widget->set_step(receiver_model.frequency_step());
|
widget->set_step(receiver_model.frequency_step());
|
||||||
widget->on_change_step = [this](rf::Frequency f) {
|
widget->on_change_step = [this](rf::Frequency f) {
|
||||||
@ -239,10 +236,7 @@ void AnalogAudioView::on_show_options_rf_gain() {
|
|||||||
|
|
||||||
field_lna.set_style(&style_options_group);
|
field_lna.set_style(&style_options_group);
|
||||||
|
|
||||||
auto widget = std::make_unique<RadioGainOptionsView>(
|
auto widget = std::make_unique<RadioGainOptionsView>(options_view_rect, &style_options_group);
|
||||||
Rect { 0 * 8, 1 * 16, 30 * 8, 1 * 16 },
|
|
||||||
&style_options_group
|
|
||||||
);
|
|
||||||
|
|
||||||
widget->set_rf_amp(receiver_model.rf_amp());
|
widget->set_rf_amp(receiver_model.rf_amp());
|
||||||
widget->on_change_rf_amp = [this](bool enable) {
|
widget->on_change_rf_amp = [this](bool enable) {
|
||||||
@ -259,18 +253,12 @@ void AnalogAudioView::on_show_options_modulation() {
|
|||||||
const auto modulation = static_cast<ReceiverModel::Mode>(receiver_model.modulation());
|
const auto modulation = static_cast<ReceiverModel::Mode>(receiver_model.modulation());
|
||||||
if( modulation == ReceiverModel::Mode::AMAudio ) {
|
if( modulation == ReceiverModel::Mode::AMAudio ) {
|
||||||
options_modulation.set_style(&style_options_group);
|
options_modulation.set_style(&style_options_group);
|
||||||
auto widget = std::make_unique<AMOptionsView>(
|
auto widget = std::make_unique<AMOptionsView>(options_view_rect, &style_options_group);
|
||||||
Rect { 0 * 8, 1 * 16, 30 * 8, 1 * 16 },
|
|
||||||
&style_options_group
|
|
||||||
);
|
|
||||||
set_options_widget(std::move(widget));
|
set_options_widget(std::move(widget));
|
||||||
}
|
}
|
||||||
if( modulation == ReceiverModel::Mode::NarrowbandFMAudio ) {
|
if( modulation == ReceiverModel::Mode::NarrowbandFMAudio ) {
|
||||||
options_modulation.set_style(&style_options_group);
|
options_modulation.set_style(&style_options_group);
|
||||||
auto widget = std::make_unique<NBFMOptionsView>(
|
auto widget = std::make_unique<NBFMOptionsView>(options_view_rect, &style_options_group);
|
||||||
Rect { 0 * 8, 1 * 16, 30 * 8, 1 * 16 },
|
|
||||||
&style_options_group
|
|
||||||
);
|
|
||||||
set_options_widget(std::move(widget));
|
set_options_widget(std::move(widget));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
static constexpr ui::Dim header_height = 2 * 16;
|
static constexpr ui::Dim header_height = 2 * 16;
|
||||||
|
|
||||||
|
const Rect options_view_rect { 0 * 8, 1 * 16, 30 * 8, 1 * 16 };
|
||||||
|
|
||||||
RSSI rssi {
|
RSSI rssi {
|
||||||
{ 21 * 8, 0, 6 * 8, 4 },
|
{ 21 * 8, 0, 6 * 8, 4 },
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user