Split ADSB TX into tabs

Simplified TabView a lot
This commit is contained in:
furrtek 2017-07-30 14:46:42 +01:00
parent 89a3afcd74
commit a5f0f72ea1
8 changed files with 358 additions and 240 deletions

View file

@ -96,8 +96,10 @@ void GeoMapView::move_map() {
}
GeoMapView::GeoMapView(
NavigationView& nav
) : nav_ (nav)
NavigationView& nav,
Mode mode
) : nav_ (nav),
mode_ (mode)
{
auto result = map_file.open("ADSB/world_map.bin");
if (result.is_valid()) {
@ -113,19 +115,22 @@ GeoMapView::GeoMapView(
add_children({
&field_xpos,
&field_ypos,
&field_angle
&field_ypos
});
if (mode_ == SHOW) {
add_child(&field_angle);
field_angle.on_change = [this](int32_t) {
move_map();
};
}
field_xpos.on_change = [this](int32_t) {
move_map();
};
field_ypos.on_change = [this](int32_t) {
move_map();
};
field_angle.on_change = [this](int32_t) {
move_map();
};
}
} /* namespace ui */