Page MenuHomePhabricator

Spinner inside collapsed frame inside naviframe cannot be edited
Open, Incoming QueuePublic

Description

When to naviframe's panels we add collapsed frames with spinners as a content, these cannot be edited after we uncollapse the frame. The same is true for entries instead of spinners. I did not observe any such an error when frame is not part of naviframe. A sample case is attached below. Tested with efl 1.24.1 and 1.23.0.

#include <Elementary.h>

Evas_Object *w, *b, *b_, *f1, *f2, *f3, *f4, *l, *s1, *s2, *s3, *s4, *n, *bn;

void _push(void *data, Evas_Object *obj, void *event_info) {
    elm_naviframe_item_push(n, "b_", NULL, NULL, b_, NULL);
}

EAPI_MAIN int elm_main(int argc, char **argv) {
    w = elm_win_util_standard_add("Frame-Spinner", "Frame-Spinner");
    elm_win_autodel_set(w, 1);
    evas_object_show(w);

    evas_object_resize (w, 256, 512);

    b = elm_box_add(w);
    evas_object_show(b);

    f1 = elm_frame_add(w);
    elm_object_text_set(f1, "frame collapsed");
    elm_frame_autocollapse_set(f1, EINA_TRUE);
    elm_frame_collapse_set(f1, 1);
    evas_object_size_hint_weight_set(f1, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(f1, EVAS_HINT_FILL, 0.0);
    elm_box_pack_end(b, f1);
    evas_object_show(f1);

    f2 = elm_frame_add(w);
    elm_object_text_set(f2, "frame uncollapsed");
    evas_object_size_hint_weight_set(f2, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(f2, EVAS_HINT_FILL, 0.0);
    elm_box_pack_end(b, f2);
    evas_object_show(f2);

    s1 = elm_spinner_add(w);
	elm_spinner_editable_set(s1, EINA_TRUE);
    elm_spinner_step_set        (s1, 0.5);
    elm_spinner_label_format_set(s1, "%2.1f");
    evas_object_show(s1);
    elm_object_content_set(f1, s1);

    s2 = elm_spinner_add(w);
	elm_spinner_editable_set(s2, EINA_TRUE);
    elm_spinner_step_set        (s2, 0.5);
    elm_spinner_label_format_set(s2, "%2.1f");
    evas_object_show(s2);
    elm_object_content_set(f2, s2);

    b_ = elm_box_add(w);
    evas_object_size_hint_weight_set(b_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(b_, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_show(b_);

    f3 = elm_frame_add(w);
    elm_object_text_set(f3, "frame collapsed");
    elm_frame_autocollapse_set(f3, EINA_TRUE);
    elm_frame_collapse_set(f3, 1);
    evas_object_size_hint_weight_set(f3, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(f3, EVAS_HINT_FILL, 0.0);
    elm_box_pack_end(b_, f3);
    evas_object_show(f3);

    f4 = elm_frame_add(w);
    elm_object_text_set(f4, "frame uncollapsed");
    evas_object_size_hint_weight_set(f4, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(f4, EVAS_HINT_FILL, 0.0);
    elm_box_pack_end(b_, f4);
    evas_object_show(f4);

    s3 = elm_spinner_add(w);
	elm_spinner_editable_set(s3, EINA_TRUE);
    elm_spinner_step_set        (s3, 0.5);
    elm_spinner_label_format_set(s3, "%2.1f");
    evas_object_show(s3);
    elm_object_content_set(f3, s3);

    s4 = elm_spinner_add(w);
	elm_spinner_editable_set(s4, EINA_TRUE);
    elm_spinner_step_set        (s4, 0.5);
    elm_spinner_label_format_set(s4, "%2.1f");
    evas_object_show(s4);
    elm_object_content_set(f4, s4);

    Evas_Object *bn = elm_button_add(w);
    elm_object_text_set(bn, "następny");
    evas_object_smart_callback_add(bn, "clicked", _push, NULL);
    evas_object_show(bn);

    n = elm_naviframe_add(w);
    elm_win_resize_object_add(w, n);
    evas_object_size_hint_weight_set(n, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(n, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_naviframe_content_preserve_on_pop_set(n, 1);
    evas_object_show(n);

    elm_object_item_part_content_set(elm_naviframe_item_push(n, "b", NULL, NULL, b, NULL), "next_btn", bn);
    elm_naviframe_item_push(n, "b_", NULL, NULL, b_, NULL);
    elm_naviframe_item_pop(n);

    elm_run();

    return 0;
}
ELM_MAIN()