mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Extract AIS record renderer from AISView.
This commit is contained in:
parent
a29b76ac38
commit
d380ffe52b
@ -210,7 +210,7 @@ bool AISView::on_encoder(const EncoderEvent event) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AISView::draw_entry(
|
static void ais_list_item_draw(
|
||||||
const AISRecentEntry& entry,
|
const AISRecentEntry& entry,
|
||||||
const Rect& target_rect,
|
const Rect& target_rect,
|
||||||
Painter& painter,
|
Painter& painter,
|
||||||
@ -261,7 +261,7 @@ void AISView::paint(Painter& painter) {
|
|||||||
for(auto p = start; p != end; p++) {
|
for(auto p = start; p != end; p++) {
|
||||||
const auto& entry = *p;
|
const auto& entry = *p;
|
||||||
const auto is_selected_key = (selected_key == entry.mmsi);
|
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();
|
target_rect.pos.y += target_rect.height();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,14 +105,6 @@ private:
|
|||||||
|
|
||||||
void on_packet(const ais::Packet& packet);
|
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();
|
void truncate_entries();
|
||||||
|
|
||||||
RecentEntries::iterator selected_entry();
|
RecentEntries::iterator selected_entry();
|
||||||
|
Loading…
Reference in New Issue
Block a user