mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-13 18:33:38 +00: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();
|
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) {
|
void AISView::paint(Painter& painter) {
|
||||||
const auto r = screen_rect();
|
const auto r = screen_rect();
|
||||||
const auto& s = style();
|
const auto& s = style();
|
||||||
|
@ -118,14 +118,23 @@ namespace ui {
|
|||||||
|
|
||||||
class AISView : public View {
|
class AISView : public View {
|
||||||
public:
|
public:
|
||||||
|
AISView() {
|
||||||
|
flags.focusable = true;
|
||||||
|
}
|
||||||
|
|
||||||
void on_show() override;
|
void on_show() override;
|
||||||
void on_hide() override;
|
void on_hide() override;
|
||||||
|
|
||||||
void paint(Painter& painter) override;
|
void paint(Painter& painter) override;
|
||||||
|
|
||||||
|
void on_focus() override;
|
||||||
|
void on_blur() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AISModel model;
|
AISModel model;
|
||||||
|
|
||||||
|
bool has_focus = false;
|
||||||
|
|
||||||
struct Position {
|
struct Position {
|
||||||
rtc::RTC timestamp { };
|
rtc::RTC timestamp { };
|
||||||
baseband::ais::Latitude latitude { 0 };
|
baseband::ais::Latitude latitude { 0 };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user