Page MenuHomePhabricator

evas_box: fix calculation logic when item's weight is 0.0.
Needs ReviewPublic

Authored by eagleeye on Wed, Dec 5, 2:39 AM.

Details

Summary

In case of box item's size and min size are different,
box item position is calculated incorrectly.
Please check with example code.

Test Plan

/*

  • gcc -o box_example box_example.c pkg-config --cflags --libs elementary */

#include <Elementary.h>

EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{

Evas_Object *win = NULL;
Evas_Object *btn = NULL;

elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

win = elm_win_util_standard_add("Greetings", "Hello, World!");
elm_win_autodel_set(win, EINA_TRUE);

Evas_Object *box = evas_object_box_add(evas_object_evas_get(win));
evas_object_box_layout_set(box, evas_object_box_layout_horizontal, NULL, NULL);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(box);
elm_win_resize_object_add(win, box);

btn = elm_button_add(win);
elm_object_text_set(btn, "Good-Bye");
evas_object_size_hint_weight_set(btn, 0.0, 0.0);
evas_object_resize(btn, 100,100);
evas_object_box_append(box, btn);
evas_object_show(btn);

btn = elm_button_add(win);
elm_object_text_set(btn, "World!");
evas_object_size_hint_weight_set(btn, 0.0, 0.0);
evas_object_resize(btn, 100,100);
evas_object_box_append(box, btn);
evas_object_show(btn);

evas_object_resize(win, 200, 100);
evas_object_show(win);

elm_run();

return 0;

}
ELM_MAIN()

Diff Detail

Repository
rEFL core/efl
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 8332
eagleeye created this revision.Wed, Dec 5, 2:39 AM
eagleeye requested review of this revision.Wed, Dec 5, 2:39 AM
eagleeye edited the test plan for this revision. (Show Details)Wed, Dec 5, 2:40 AM
eagleeye added a reviewer: Jaehyun.

@raster

Could you give some comments on this patch? :)