bool intf_mini_player_visible_set(interface *intf, bool visible) { if(intf->mini_player_layout == NULL) { LOGE("No mini player instance"); return false; } if(visible) { /* show */ elm_box_pack_end(intf->main_box, intf->mini_player_layout); evas_object_show(intf->mini_player_layout); elm_box_recalculate(intf->main_box); } else { elm_box_unpack(intf->main_box, intf->mini_player_layout); evas_object_hide(intf->mini_player_layout); elm_box_recalculate(intf->main_box); } evas_object_image_source_visible_set(intf->mini_player_layout, visible); return true; }
static Evas_Object* create_main_box(interface *intf, Evas_Object *parent) { /* Create a content box to display the content and the mini player */ intf->main_box = elm_box_add(parent); elm_box_horizontal_set(intf->main_box, EINA_FALSE); /* Main View Naviframe */ intf->nf_content = elm_naviframe_add(intf->main_box); /* Put the naviframe at the top of the content_box */ evas_object_size_hint_weight_set(intf->nf_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(intf->nf_content, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(intf->main_box, intf->nf_content); /* Library scan progress */ intf->scan_progress = elm_progressbar_add(intf->main_box); elm_progressbar_unit_format_set(intf->scan_progress, "Scanning... %.0f%%"); elm_progressbar_horizontal_set(intf->scan_progress, EINA_TRUE); evas_object_size_hint_weight_set(intf->scan_progress, EVAS_HINT_EXPAND, EVAS_HINT_FILL); evas_object_size_hint_align_set(intf->scan_progress, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_hide(intf->scan_progress); /* Mini Player creation */ intf->mini_player_layout = elm_layout_add(intf->main_box); intf->p_mini_player = audio_player_create(intf, application_get_playback_service(intf->p_app), intf->mini_player_layout); evas_object_hide(intf->mini_player_layout); evas_object_size_hint_weight_set(intf->mini_player_layout, EVAS_HINT_FILL, 0.1); evas_object_size_hint_align_set(intf->mini_player_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); /* */ evas_object_show(intf->nf_content); /* Ask the global box to recalculate her current children display */ elm_box_recalculate(intf->main_box); return intf->main_box; }
void Box::recalculate() { elm_box_recalculate(getHandle()); }