mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Track when AISView has focus.
This commit is contained in:
parent
1c191bcd4f
commit
27684069c5
@ -405,6 +405,16 @@ void AISView::on_packet(const baseband::ais::Packet& packet) {
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
void AISView::on_focus() {
|
||||
has_focus = true;
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
void AISView::on_blur() {
|
||||
has_focus = false;
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
void AISView::paint(Painter& painter) {
|
||||
const auto r = screen_rect();
|
||||
const auto& s = style();
|
||||
|
@ -118,14 +118,23 @@ namespace ui {
|
||||
|
||||
class AISView : public View {
|
||||
public:
|
||||
AISView() {
|
||||
flags.focusable = true;
|
||||
}
|
||||
|
||||
void on_show() override;
|
||||
void on_hide() override;
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
|
||||
void on_focus() override;
|
||||
void on_blur() override;
|
||||
|
||||
private:
|
||||
AISModel model;
|
||||
|
||||
bool has_focus = false;
|
||||
|
||||
struct Position {
|
||||
rtc::RTC timestamp { };
|
||||
baseband::ais::Latitude latitude { 0 };
|
||||
|
Loading…
Reference in New Issue
Block a user