Extract AIS record renderer from AISView.

This commit is contained in:
Jared Boone 2016-01-13 11:56:23 -08:00
parent a29b76ac38
commit d380ffe52b
2 changed files with 2 additions and 10 deletions

View File

@ -210,7 +210,7 @@ bool AISView::on_encoder(const EncoderEvent event) {
return true;
}
void AISView::draw_entry(
static void ais_list_item_draw(
const AISRecentEntry& entry,
const Rect& target_rect,
Painter& painter,
@ -261,7 +261,7 @@ void AISView::paint(Painter& painter) {
for(auto p = start; p != end; p++) {
const auto& entry = *p;
const auto is_selected_key = (selected_key == entry.mmsi);
draw_entry(entry, target_rect, painter, s, (has_focus && is_selected_key));
ais_list_item_draw(entry, target_rect, painter, s, (has_focus && is_selected_key));
target_rect.pos.y += target_rect.height();
}
}

View File

@ -105,14 +105,6 @@ private:
void on_packet(const ais::Packet& packet);
void draw_entry(
const AISRecentEntry& entry,
const Rect& target_rect,
Painter& painter,
const Style& style,
const bool is_selected
);
void truncate_entries();
RecentEntries::iterator selected_entry();