forked from enlightenment/efl
multibuttonentry: Fix box item append rtl when mirror enabled.
Summary: MBE item append logic changed when mirrored set as true. The item appended from left side of internal box to right side, even mirrored set as true. @fix Test Plan: Precondition : elm_widget_mirrored_set as true. Run mbe sample in elementary_test. Add item. Reviewers: cedric, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2975
This commit is contained in:
parent
f9b154c5ed
commit
8c30b69453
|
@ -1306,6 +1306,7 @@ _box_layout_cb(Evas_Object *o,
|
|||
const Eina_List *l, *l_next;
|
||||
Evas_Object *obj;
|
||||
double ax, ay;
|
||||
Eina_Bool rtl;
|
||||
|
||||
if (!_box_min_size_calculate(o, priv, &lineh, data)) return;
|
||||
|
||||
|
@ -1313,6 +1314,10 @@ _box_layout_cb(Evas_Object *o,
|
|||
|
||||
evas_object_size_hint_min_get(o, &minw, &minh);
|
||||
evas_object_size_hint_align_get(o, &ax, &ay);
|
||||
|
||||
rtl = elm_widget_mirrored_get(data);
|
||||
if (rtl) ax = 1.0 - ax;
|
||||
|
||||
if (w < minw)
|
||||
{
|
||||
x = x + ((w - minw) * (1.0 - ax));
|
||||
|
@ -1342,6 +1347,7 @@ _box_layout_cb(Evas_Object *o,
|
|||
fw = fh = EINA_FALSE;
|
||||
if (ax == -1.0) {fw = 1; ax = 0.5; }
|
||||
if (ay == -1.0) {fh = 1; ay = 0.5; }
|
||||
if (rtl) ax = 1.0 - ax;
|
||||
|
||||
ww = mnw;
|
||||
if (wx)
|
||||
|
@ -1366,7 +1372,8 @@ _box_layout_cb(Evas_Object *o,
|
|||
}
|
||||
|
||||
evas_object_move(obj,
|
||||
xx + (Evas_Coord)(((double)(ww - ow)) * ax),
|
||||
((!rtl) ? (xx) : (x + (w - (xx - x) - ww)))
|
||||
+ (Evas_Coord)(((double)(ww - ow)) * ax),
|
||||
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
|
||||
evas_object_resize(obj, ow, oh);
|
||||
|
||||
|
|
Loading…
Reference in New Issue