Move app-level config to new AISAppView class.

This commit is contained in:
Jared Boone
2016-01-14 09:41:58 -08:00
parent 1f2b28b2b8
commit 6e0aa79d44
2 changed files with 41 additions and 38 deletions

View File

@@ -108,8 +108,7 @@ namespace ui {
class AISRecentEntriesView : public View {
public:
AISRecentEntriesView();
~AISRecentEntriesView();
AISRecentEntriesView(AISRecentEntries& recent);
void paint(Painter& painter) override;
@@ -119,29 +118,31 @@ public:
bool on_encoder(const EncoderEvent event) override;
private:
AISLogger logger;
AISRecentEntries& recent;
using EntryKey = ais::MMSI;
EntryKey selected_key;
const EntryKey invalid_key = 0xffffffff;
bool has_focus = false;
AISRecentEntries recent;
void on_packet(const ais::Packet& packet);
void advance(const int32_t amount);
};
class AISAppView : public View {
public:
AISAppView();
~AISAppView();
void set_parent_rect(const Rect new_parent_rect) override;
private:
AISRecentEntriesView recent_entries_view;
AISRecentEntries recent;
AISLogger logger;
AISRecentEntriesView recent_entries_view { recent };
void on_packet(const ais::Packet& packet);
};
} /* namespace ui */