Skip to content

Commit

Permalink
Factorize exit behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
guyou committed May 20, 2021
1 parent 7fc0d79 commit 721325e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/app/sailing/sailing_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ void sailing_activate_cb( void ) {
* set sailing app active on enter tile
*/
sailing_app_active = true;
/**
* Ensure status bar
*/
statusbar_hide( false );
/**
* if wifi active, enable udp listner
*/
Expand Down
10 changes: 1 addition & 9 deletions src/app/sailing/sailing_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ lv_obj_t *sailing_track_switch = NULL;

bool tracking = false;

static void exit_sailing_setup_event_cb( lv_obj_t * obj, lv_event_t event );
static void sailing_foobar_switch_event_cb( lv_obj_t * obj, lv_event_t event );
static void sailing_track_switch_event_cb( lv_obj_t * obj, lv_event_t event );

Expand All @@ -60,7 +59,7 @@ void sailing_setup_setup( uint32_t tile_num ) {
/**
* add setup header with exit button
*/
lv_obj_t *header = wf_add_settings_header( sailing_setup_tile, "Exit setup", exit_sailing_setup_event_cb );
lv_obj_t *header = wf_add_settings_header( sailing_setup_tile, "Exit setup" );
lv_obj_align( header, sailing_setup_tile, LV_ALIGN_IN_TOP_LEFT, 10, 10 );
/**
* setup always on display switch
Expand Down Expand Up @@ -91,10 +90,3 @@ static void sailing_track_switch_event_cb( lv_obj_t * obj, lv_event_t event ) {
break;
}
}

static void exit_sailing_setup_event_cb( lv_obj_t * obj, lv_event_t event ) {
switch( event ) {
case( LV_EVENT_CLICKED ): mainbar_jump_back();
break;
}
}

0 comments on commit 721325e

Please sign in to comment.