Beispiel #1
0
static void
win_back_cb(void *data, Evas_Object *obj, void *event_info)
{
	appdata_s *ad = data;
	/* Let window go to hide state. */
	elm_win_lower(ad->win);
}
static void _quit_cb(void *data, Evas_Object* obj, void* event_info)
{
    Evas_Object *win = (Evas_Object *) data;
    elm_win_lower(win);
}
Beispiel #3
0
static void
intf_pop_view(interface *intf)
{
    if (naviframe_count(intf->nf_content) == 1)
    {
        playback_service *p_ps = application_get_playback_service(intf->p_app);

        if (playback_service_is_playing(p_ps))
        {
            /* Lower the window (but keep the mainloop running) */
            elm_win_lower(intf->win);
            playback_service_set_auto_exit(p_ps, true);
        }
        else
        {
            ui_app_exit();
        }
        return;
    }

    /* Get the top of the NaviFrame Stack */
    Elm_Object_Item *it = elm_naviframe_top_item_get(intf->nf_content);
    interface_view *view = (interface_view *)elm_object_item_data_get(it);
    if (view) {
        if(view->pf_stop != NULL) {
            view->pf_stop(view->p_view_sys);
        }
    }

    // NOTE: When pop() is called a naviframe will free the content of the item
    //       unless elm_naviframe_content_preserve_on_pop_set is set but this
    //       function seems broken or underspecified (at least in Tizen 2.3 SDK).
    //       To workaround this issue there's two options:
    //
    //       * Don't recycle view and instantiate a new one instead
    //       * Remove the view from the item before calling pop()
    //
    //       The second option has one drawback though, once unset the part
    //       will be flying and needs to be hidden until it's reattached.

    evas_object_hide(elm_object_part_content_unset(intf->nf_content, "elm.swallow.content"));

    /* Pop the top view */
    elm_naviframe_item_pop(intf->nf_content);
    elm_win_indicator_opacity_set(intf->win, ELM_WIN_INDICATOR_OPAQUE);

    Evas_Object *sidebar_toggle_btn = create_button(intf->nf_content, "naviframe/drawers");
    evas_object_smart_callback_add(sidebar_toggle_btn, "clicked", left_panel_button_clicked_cb, intf);
    elm_object_part_content_set(intf->nf_content, "title_left_btn", sidebar_toggle_btn);

    view = (interface_view *)elm_object_item_data_get(elm_naviframe_top_item_get(intf->nf_content));
    if (view)
    {
        intf->current_view = view->i_type;
        sidebar_set_selected_view(intf->sidebar, intf->current_view);

        if (view->pf_has_menu && view->pf_has_menu(view->p_view_sys) == true)
        {
            Evas_Object *popup_toggle_btn = create_button(intf->nf_content, "naviframe/custom_more");
            evas_object_smart_callback_add(popup_toggle_btn, "clicked", right_panel_button_clicked_cb, intf);
            elm_object_part_content_set(intf->nf_content, "title_right_btn", popup_toggle_btn);
            evas_object_show(popup_toggle_btn);
        }

        evas_object_show(view->view);
    }
    else
    {
        LOGE("Cannot get view metadata");
    }
}