forked from enlightenment/efl
edje_calc: Creation macro that perform edje calc, regardless of the edje size.
Summary: edje_recalc_do() needs to be executed regardless of the size of edje in order to deliver edje properties for the API that the user calls. Reviewers: cedric, Hermet, Jaehyun_Cho, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10724
This commit is contained in:
parent
256c792837
commit
4ebbe0ad04
|
@ -1003,30 +1003,6 @@ _edje_recalc_table_parts(Edje *ed
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defined in edje_textblock.c
|
|
||||||
Eina_Bool
|
|
||||||
_edje_part_textblock_style_text_set(Edje *ed,
|
|
||||||
Edje_Real_Part *ep,
|
|
||||||
Edje_Part_Description_Text *chosen_desc);
|
|
||||||
|
|
||||||
void
|
|
||||||
_edje_recalc_textblock_style_text_set(Edje *ed)
|
|
||||||
{
|
|
||||||
unsigned short i;
|
|
||||||
Edje_Real_Part *ep;
|
|
||||||
|
|
||||||
for (i = 0; i < ed->table_parts_size; i++)
|
|
||||||
{
|
|
||||||
ep = ed->table_parts[i];
|
|
||||||
|
|
||||||
if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK)
|
|
||||||
{
|
|
||||||
_edje_part_textblock_style_text_set
|
|
||||||
(ed, ep, (Edje_Part_Description_Text *)ep->chosen_description);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_edje_recalc_do(Edje *ed)
|
_edje_recalc_do(Edje *ed)
|
||||||
{
|
{
|
||||||
|
@ -1037,14 +1013,9 @@ _edje_recalc_do(Edje *ed)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//Do nothing if the edje has no size, Regardless of the edje part size calc,
|
//Do nothing if the edje has no size,
|
||||||
//the text and style has to be set.
|
|
||||||
if ((EINA_UNLIKELY(!ed->has_size)) && (!ed->calc_only) && (ed->w == 0) && (ed->h == 0))
|
if ((EINA_UNLIKELY(!ed->has_size)) && (!ed->calc_only) && (ed->w == 0) && (ed->h == 0))
|
||||||
{
|
return;
|
||||||
_edje_recalc_textblock_style_text_set(ed);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ed->has_size = EINA_TRUE;
|
ed->has_size = EINA_TRUE;
|
||||||
|
|
||||||
need_calc = evas_object_smart_need_recalculate_get(ed->obj);
|
need_calc = evas_object_smart_need_recalculate_get(ed->obj);
|
||||||
|
|
|
@ -4,6 +4,20 @@
|
||||||
#include "../evas/canvas/evas_line_eo.h"
|
#include "../evas/canvas/evas_line_eo.h"
|
||||||
#include "../evas/canvas/evas_text_eo.h"
|
#include "../evas/canvas/evas_text_eo.h"
|
||||||
|
|
||||||
|
//In implementations that gets properties for user-created edje,
|
||||||
|
//edje calculation should be performed regardless of the size of edje.
|
||||||
|
#define EDJE_RECALC_DO(ed) \
|
||||||
|
do { \
|
||||||
|
Eina_Bool calc_flag = EINA_FALSE; \
|
||||||
|
if (!ed->has_size) \
|
||||||
|
{ \
|
||||||
|
ed->has_size = EINA_TRUE; \
|
||||||
|
calc_flag = EINA_TRUE; \
|
||||||
|
} \
|
||||||
|
_edje_recalc_do(ed); \
|
||||||
|
if (calc_flag) ed->has_size = EINA_FALSE; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
typedef struct _Edje_Box_Layout Edje_Box_Layout;
|
typedef struct _Edje_Box_Layout Edje_Box_Layout;
|
||||||
struct _Edje_Box_Layout
|
struct _Edje_Box_Layout
|
||||||
{
|
{
|
||||||
|
@ -1945,7 +1959,7 @@ edje_object_part_object_get(const Eo *obj, const char *part)
|
||||||
if ((!ed) || (!part)) return NULL;
|
if ((!ed) || (!part)) return NULL;
|
||||||
|
|
||||||
/* Need to recalc before providing the object. */
|
/* Need to recalc before providing the object. */
|
||||||
if (!ed->freeze) _edje_recalc_do(ed);
|
if (!ed->freeze) EDJE_RECALC_DO(ed);
|
||||||
|
|
||||||
rp = _edje_real_part_recursive_get(&ed, part);
|
rp = _edje_real_part_recursive_get(&ed, part);
|
||||||
if (!rp) return NULL;
|
if (!rp) return NULL;
|
||||||
|
@ -2187,7 +2201,7 @@ _edje_efl_text_text_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *part,
|
||||||
#else
|
#else
|
||||||
if (ed->dirty)
|
if (ed->dirty)
|
||||||
#endif
|
#endif
|
||||||
_edje_recalc_do(ed);
|
EDJE_RECALC_DO(ed);
|
||||||
entry = evas_object_textblock_text_markup_get(rp->object);
|
entry = evas_object_textblock_text_markup_get(rp->object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2200,7 +2214,7 @@ _edje_efl_text_text_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *part,
|
||||||
#else
|
#else
|
||||||
if (ed->dirty)
|
if (ed->dirty)
|
||||||
#endif
|
#endif
|
||||||
_edje_recalc_do(ed);
|
EDJE_RECALC_DO(ed);
|
||||||
entry = efl_text_markup_get(rp->object);
|
entry = efl_text_markup_get(rp->object);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3580,7 +3594,7 @@ _efl_canvas_layout_efl_layout_group_group_size_max_get(const Eo *obj EINA_UNUSED
|
||||||
return EINA_SIZE2D(0, 0);
|
return EINA_SIZE2D(0, 0);
|
||||||
|
|
||||||
/* Need to recalc before providing the object. */
|
/* Need to recalc before providing the object. */
|
||||||
if (!ed->freeze) _edje_recalc_do(ed);
|
if (!ed->freeze) EDJE_RECALC_DO(ed);
|
||||||
|
|
||||||
sz = ed->collection->prop.max;
|
sz = ed->collection->prop.max;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue