Hello all,
I have a textblock with "fit: 1 1". When it first gets loaded, the
text within the textblock is very small.
After some time, I change the text and the text size seems to be more correct.
I guess the geometry calculation of the textblock is somehow broken
when the window is first created.
Please find the attached for a simple demonstration of the problem.
Thanks in advance.
Brian
--
brian
------------------
Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/
iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
#include <stdio.h>
#include <stdlib.h>
#include <Elementary.h>
static void _init(void);
static void _text_set(Evas_Object *ly, const char *str)
{
elm_object_part_text_set(ly, "my-text", str);
}
static Eina_Bool _text_size_change(void *data)
{
Evas_Object *ly = data;
fprintf(stderr, "%s : in\n", __func__);
_text_set(ly, "We want a very long long text 2.");
return ECORE_CALLBACK_CANCEL;
}
static void _init(void)
{
Evas_Object *win, *bg, *ly, *bt;
win = elm_win_add(NULL, "x", ELM_WIN_BASIC);
elm_win_autodel_set(win, EINA_TRUE);
/* add a standard bg */
bg = elm_bg_add(win);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
ly = elm_layout_add(win);
elm_layout_file_set(ly, "theme.edj", "bug");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_resize_object_add(win, ly);
evas_object_show(ly);
_text_set(ly, "We want a very long long text.");
evas_object_resize(win, 320, 240);
evas_object_show(win);
ecore_timer_add(3.0, _text_size_change, ly);
}
EAPI int elm_main(int argc, char **argv)
{
_init();
/* get going and draw/respond to the user */
elm_run();
elm_shutdown();
return 0;
}
ELM_MAIN()
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
collections {
group {
name: "bug";
styles
{
style { name: "lyrics_style";
base: "font=Sans font_size=40 align=left color=#0000ff wrap=word";
tag: "br" "\n";
tag: "hilight" "+ font=Sans:style=Bold";
tag: "att" "+ style=shadow color=#f0e68cff shadow_color=#000000";
tag: "quiet" "+ style=shadow color=#ffffffe0 shadow_color=#000000";
}
}
parts
{
part { name: "my-text";
type: TEXTBLOCK;
scale: 1;
mouse_events: 0;
repeat_events: 1;
description {
state: "default" 0.0;
align: 0.0 0.5;
fixed: 1 1;
rel1 {
relative: 0.0 0.0;
}
rel2 {
relative: 1.0 0.5;
}
text {
style: "lyrics_style";
min: 0 0;
fit: 1 1;
}
}
}
}
}
}
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel