Setup Tile - Scroll by dragging icon
This commit is contained in:
@@ -181,8 +181,13 @@ void mainbar_jump_to_tilenumber( uint32_t tile_number, lv_anim_enable_t anim ) {
|
|||||||
|
|
||||||
lv_obj_t * mainbar_obj_create(lv_obj_t *parent)
|
lv_obj_t * mainbar_obj_create(lv_obj_t *parent)
|
||||||
{
|
{
|
||||||
lv_obj_t * child = lv_obj_create( parent, NULL );
|
lv_obj_t * child = lv_cont_create( parent, NULL );
|
||||||
lv_tileview_add_element( mainbar, child );
|
lv_tileview_add_element( mainbar, child );
|
||||||
|
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mainbar_add_slide_element(lv_obj_t *element)
|
||||||
|
{
|
||||||
|
lv_tileview_add_element( mainbar, element );
|
||||||
|
}
|
||||||
@@ -109,4 +109,6 @@
|
|||||||
|
|
||||||
lv_obj_t * mainbar_obj_create(lv_obj_t *parent);
|
lv_obj_t * mainbar_obj_create(lv_obj_t *parent);
|
||||||
|
|
||||||
|
void mainbar_add_slide_element(lv_obj_t *element);
|
||||||
|
|
||||||
#endif // _MAINBAR_H
|
#endif // _MAINBAR_H
|
||||||
@@ -66,6 +66,7 @@ void battery_settings_tile_setup( void ) {
|
|||||||
// register an setup icon an set an callback
|
// register an setup icon an set an callback
|
||||||
battery_setup_icon_cont = setup_tile_register_setup();
|
battery_setup_icon_cont = setup_tile_register_setup();
|
||||||
lv_obj_t *battery_setup = lv_imgbtn_create ( battery_setup_icon_cont, NULL);
|
lv_obj_t *battery_setup = lv_imgbtn_create ( battery_setup_icon_cont, NULL);
|
||||||
|
mainbar_add_slide_element(battery_setup);
|
||||||
lv_imgbtn_set_src( battery_setup, LV_BTN_STATE_RELEASED, &battery_icon_64px);
|
lv_imgbtn_set_src( battery_setup, LV_BTN_STATE_RELEASED, &battery_icon_64px);
|
||||||
lv_imgbtn_set_src( battery_setup, LV_BTN_STATE_PRESSED, &battery_icon_64px);
|
lv_imgbtn_set_src( battery_setup, LV_BTN_STATE_PRESSED, &battery_icon_64px);
|
||||||
lv_imgbtn_set_src( battery_setup, LV_BTN_STATE_CHECKED_RELEASED, &battery_icon_64px);
|
lv_imgbtn_set_src( battery_setup, LV_BTN_STATE_CHECKED_RELEASED, &battery_icon_64px);
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ void display_settings_tile_setup( void ) {
|
|||||||
// register an setup icon an set an callback
|
// register an setup icon an set an callback
|
||||||
display_setup_icon_cont = setup_tile_register_setup();
|
display_setup_icon_cont = setup_tile_register_setup();
|
||||||
lv_obj_t *display_setup_icon = lv_imgbtn_create ( display_setup_icon_cont, NULL);
|
lv_obj_t *display_setup_icon = lv_imgbtn_create ( display_setup_icon_cont, NULL);
|
||||||
|
mainbar_add_slide_element(display_setup_icon);
|
||||||
lv_imgbtn_set_src( display_setup_icon, LV_BTN_STATE_RELEASED, &brightness_64px);
|
lv_imgbtn_set_src( display_setup_icon, LV_BTN_STATE_RELEASED, &brightness_64px);
|
||||||
lv_imgbtn_set_src( display_setup_icon, LV_BTN_STATE_PRESSED, &brightness_64px);
|
lv_imgbtn_set_src( display_setup_icon, LV_BTN_STATE_PRESSED, &brightness_64px);
|
||||||
lv_imgbtn_set_src( display_setup_icon, LV_BTN_STATE_CHECKED_RELEASED, &brightness_64px);
|
lv_imgbtn_set_src( display_setup_icon, LV_BTN_STATE_CHECKED_RELEASED, &brightness_64px);
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ void move_settings_tile_setup( void ) {
|
|||||||
|
|
||||||
// register an setup icon an set an callback
|
// register an setup icon an set an callback
|
||||||
lv_obj_t *move_setup = lv_imgbtn_create ( setup_tile_register_setup(), NULL);
|
lv_obj_t *move_setup = lv_imgbtn_create ( setup_tile_register_setup(), NULL);
|
||||||
|
mainbar_add_slide_element(move_setup);
|
||||||
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_RELEASED, &move_64px);
|
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_RELEASED, &move_64px);
|
||||||
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_PRESSED, &move_64px);
|
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_PRESSED, &move_64px);
|
||||||
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_CHECKED_RELEASED, &move_64px);
|
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_CHECKED_RELEASED, &move_64px);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ void setup_tile_setup( void ) {
|
|||||||
setup_entry[ setup ].y = SETUP_FIRST_Y_POS + ( ( setup / MAX_SETUP_ICON_HORZ ) * ( SETUP_ICON_Y_SIZE + SETUP_ICON_Y_CLEARENCE ) );
|
setup_entry[ setup ].y = SETUP_FIRST_Y_POS + ( ( setup / MAX_SETUP_ICON_HORZ ) * ( SETUP_ICON_Y_SIZE + SETUP_ICON_Y_CLEARENCE ) );
|
||||||
setup_entry[ setup ].active = false;
|
setup_entry[ setup ].active = false;
|
||||||
// create app icon container
|
// create app icon container
|
||||||
setup_entry[ setup ].setup = lv_obj_create( setup_cont, NULL );
|
setup_entry[ setup ].setup = mainbar_obj_create( setup_cont );
|
||||||
lv_obj_reset_style_list( setup_entry[ setup ].setup, LV_OBJ_PART_MAIN );
|
lv_obj_reset_style_list( setup_entry[ setup ].setup, LV_OBJ_PART_MAIN );
|
||||||
lv_obj_add_style( setup_entry[ setup ].setup, LV_OBJ_PART_MAIN, &setup_style );
|
lv_obj_add_style( setup_entry[ setup ].setup, LV_OBJ_PART_MAIN, &setup_style );
|
||||||
lv_obj_set_size( setup_entry[ setup ].setup, SETUP_ICON_X_SIZE, SETUP_ICON_Y_SIZE );
|
lv_obj_set_size( setup_entry[ setup ].setup, SETUP_ICON_X_SIZE, SETUP_ICON_Y_SIZE );
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ void time_settings_tile_setup( void ) {
|
|||||||
|
|
||||||
// register an setup icon an set an callback
|
// register an setup icon an set an callback
|
||||||
lv_obj_t *move_setup = lv_imgbtn_create ( setup_tile_register_setup(), NULL);
|
lv_obj_t *move_setup = lv_imgbtn_create ( setup_tile_register_setup(), NULL);
|
||||||
|
mainbar_add_slide_element(move_setup);
|
||||||
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_RELEASED, &time_64px);
|
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_RELEASED, &time_64px);
|
||||||
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_PRESSED, &time_64px);
|
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_PRESSED, &time_64px);
|
||||||
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_CHECKED_RELEASED, &time_64px);
|
lv_imgbtn_set_src( move_setup, LV_BTN_STATE_CHECKED_RELEASED, &time_64px);
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ void update_tile_setup( void ) {
|
|||||||
// register an setup icon an set an callback
|
// register an setup icon an set an callback
|
||||||
update_setup_icon_cont = setup_tile_register_setup();
|
update_setup_icon_cont = setup_tile_register_setup();
|
||||||
lv_obj_t *update_setup = lv_imgbtn_create ( update_setup_icon_cont, NULL);
|
lv_obj_t *update_setup = lv_imgbtn_create ( update_setup_icon_cont, NULL);
|
||||||
|
mainbar_add_slide_element(update_setup);
|
||||||
lv_imgbtn_set_src( update_setup, LV_BTN_STATE_RELEASED, &update_64px);
|
lv_imgbtn_set_src( update_setup, LV_BTN_STATE_RELEASED, &update_64px);
|
||||||
lv_imgbtn_set_src( update_setup, LV_BTN_STATE_PRESSED, &update_64px);
|
lv_imgbtn_set_src( update_setup, LV_BTN_STATE_PRESSED, &update_64px);
|
||||||
lv_imgbtn_set_src( update_setup, LV_BTN_STATE_CHECKED_RELEASED, &update_64px);
|
lv_imgbtn_set_src( update_setup, LV_BTN_STATE_CHECKED_RELEASED, &update_64px);
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ void wlan_settings_tile_setup( void ) {
|
|||||||
|
|
||||||
// register an setup icon an set an callback
|
// register an setup icon an set an callback
|
||||||
lv_obj_t *wifi_setup = lv_imgbtn_create ( setup_tile_register_setup(), NULL);
|
lv_obj_t *wifi_setup = lv_imgbtn_create ( setup_tile_register_setup(), NULL);
|
||||||
|
mainbar_add_slide_element(wifi_setup);
|
||||||
lv_imgbtn_set_src( wifi_setup, LV_BTN_STATE_RELEASED, &wifi_64px);
|
lv_imgbtn_set_src( wifi_setup, LV_BTN_STATE_RELEASED, &wifi_64px);
|
||||||
lv_imgbtn_set_src( wifi_setup, LV_BTN_STATE_PRESSED, &wifi_64px);
|
lv_imgbtn_set_src( wifi_setup, LV_BTN_STATE_PRESSED, &wifi_64px);
|
||||||
lv_imgbtn_set_src( wifi_setup, LV_BTN_STATE_CHECKED_RELEASED, &wifi_64px);
|
lv_imgbtn_set_src( wifi_setup, LV_BTN_STATE_CHECKED_RELEASED, &wifi_64px);
|
||||||
|
|||||||
Reference in New Issue
Block a user