diff --git a/firmware/application/apps/ui_touch_calibration.cpp b/firmware/application/apps/ui_touch_calibration.cpp index fa91e07c5..3ee3a9637 100644 --- a/firmware/application/apps/ui_touch_calibration.cpp +++ b/firmware/application/apps/ui_touch_calibration.cpp @@ -26,6 +26,8 @@ #include "portapack_persistent_memory.hpp" using namespace portapack; +extern ui::SystemView* system_view_ptr; + namespace ui { TouchCalibrationView::TouchCalibrationView( @@ -40,6 +42,7 @@ TouchCalibrationView::TouchCalibrationView( &image_verify_1, &image_verify_2, &label_calibrate, + &label_calibrate_2, &label_verify, &label_success, &label_failure, @@ -51,6 +54,12 @@ TouchCalibrationView::TouchCalibrationView( button_ok.on_select = [this](Button&) { this->on_ok(); }; set_phase(Phase::Calibrate0); + + system_view_ptr->get_status_view()->set_back_hidden(true); +} + +TouchCalibrationView::~TouchCalibrationView() { + system_view_ptr->get_status_view()->set_back_hidden(false); } void TouchCalibrationView::focus() { @@ -70,6 +79,7 @@ void TouchCalibrationView::update_target() { image_verify_2.hidden(phase != Phase::Verify2); label_calibrate.hidden(!phase_calibrate); + label_calibrate_2.hidden(!phase_calibrate && !phase_verify); label_verify.hidden(!phase_verify); label_success.hidden(phase != Phase::Success); label_failure.hidden(phase != Phase::Failure); diff --git a/firmware/application/apps/ui_touch_calibration.hpp b/firmware/application/apps/ui_touch_calibration.hpp index f64bca1d6..18b848ace 100644 --- a/firmware/application/apps/ui_touch_calibration.hpp +++ b/firmware/application/apps/ui_touch_calibration.hpp @@ -31,6 +31,7 @@ namespace ui { class TouchCalibrationView : public View { public: TouchCalibrationView(NavigationView& nav); + ~TouchCalibrationView(); void focus() override; @@ -110,9 +111,13 @@ class TouchCalibrationView : public View { Color::black()}; Text label_calibrate{ - {16, 5 * 16, 26 * 8, 1 * 16}, + {2 * 8, 5 * 16, 26 * 8, 1 * 16}, "Touch targets to calibrate"}; + Text label_calibrate_2{ + {1 * 8, 6 * 16, 28 * 8, 1 * 16}, + "(hold position using stylus)"}; + Text label_verify{ {28, 5 * 16, 23 * 8, 1 * 16}, "Touch targets to verify"}; diff --git a/firmware/application/main.cpp b/firmware/application/main.cpp index 4ec395cb3..cff6762fc 100755 --- a/firmware/application/main.cpp +++ b/firmware/application/main.cpp @@ -144,6 +144,7 @@ Continuous (Fox-oring) #include "rffc507x.hpp" /* c/m, avoiding initial short ON Ant_DC_Bias pulse, from cold reset */ rffc507x::RFFC507x first_if; +ui::SystemView* system_view_ptr; static void event_loop() { static ui::Context context; @@ -151,6 +152,8 @@ static void event_loop() { context, portapack::display.screen_rect()}; + system_view_ptr = &system_view; + EventDispatcher event_dispatcher{&system_view, context}; static MessageHandlerRegistration message_handler_display_sleep{ Message::ID::DisplaySleep, diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 67c586363..2f36d98de 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -422,6 +422,10 @@ void SystemStatusView::set_back_enabled(bool new_value) { } } +void SystemStatusView::set_back_hidden(bool new_value) { + button_back.hidden(new_value); +} + void SystemStatusView::set_title_image_enabled(bool new_value) { if (new_value) { add_child(&button_title); @@ -896,6 +900,9 @@ Context& SystemView::context() const { NavigationView* SystemView::get_navigation_view() { return &navigation_view; } +SystemStatusView* SystemView::get_status_view() { + return &status_view; +} void SystemView::toggle_overlay() { static uint8_t last_perf_counter_status = shared_memory.request_m4_performance_counter; diff --git a/firmware/application/ui_navigation.hpp b/firmware/application/ui_navigation.hpp index 8144efd48..801e2a35f 100644 --- a/firmware/application/ui_navigation.hpp +++ b/firmware/application/ui_navigation.hpp @@ -185,6 +185,7 @@ class SystemStatusView : public View { SystemStatusView(NavigationView& nav); void set_back_enabled(bool new_value); + void set_back_hidden(bool new_value); void set_title_image_enabled(bool new_value); void set_title(const std::string new_value); @@ -378,6 +379,7 @@ class SystemView : public View { void paint_overlay(); NavigationView* get_navigation_view(); + SystemStatusView* get_status_view(); private: uint8_t overlay_active{0};