forked from enlightenment/enlightenment
parent
51c018ee5b
commit
48ab5a3723
|
@ -17,8 +17,8 @@
|
|||
#endif
|
||||
|
||||
fonts {
|
||||
font: "Vera.ttf" "Edje Vera";
|
||||
font: "VeraBd.ttf" "Edje Vera Bold";
|
||||
font: "Vera.ttf" "Edje-Vera";
|
||||
font: "VeraBd.ttf" "Edje-Vera-Bold";
|
||||
}
|
||||
|
||||
collections {
|
||||
|
|
|
@ -788,7 +788,7 @@ group {
|
|||
color3: 255 255 255 128;
|
||||
text {
|
||||
text: "";
|
||||
font: "Edje Vera";
|
||||
font: "Edje-Vera";
|
||||
size: 10;
|
||||
min: 0 1;
|
||||
align: 0.0 0.5;
|
||||
|
|
|
@ -690,7 +690,7 @@ group {
|
|||
color3: 0 0 0 32;
|
||||
text {
|
||||
text: "00:00:00 AM";
|
||||
font: "Edje Vera";
|
||||
font: "Edje-Vera";
|
||||
size: 15;
|
||||
fit: 0 1;
|
||||
align: 0.0 0.5;
|
||||
|
|
|
@ -6,6 +6,17 @@ images {
|
|||
image: "e17_button.png" COMP;
|
||||
}
|
||||
|
||||
styles
|
||||
{
|
||||
style {
|
||||
name: "dialog_style";
|
||||
base: "font=Edje-Vera font_size=10 align=left color=#000 style=shadow shadow_color=#ffffff80 wrap=word";
|
||||
|
||||
tag: "br" "\n";
|
||||
tag: "hilight" "+ font_size=10 font=Edje-Vera-Bold style=glow color=#fff glow2_color=#fe87 glow_color=#fa14";
|
||||
}
|
||||
}
|
||||
|
||||
group {
|
||||
name: "widgets/dialog/main";
|
||||
parts {
|
||||
|
@ -220,7 +231,7 @@ group {
|
|||
color3: 255 255 255 128;
|
||||
text {
|
||||
text: "OK";
|
||||
font: "Edje Vera";
|
||||
font: "Edje-Vera";
|
||||
size: 10;
|
||||
min: 0 0;
|
||||
align: 0.5 0.5;
|
||||
|
@ -251,3 +262,21 @@ group {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
group {
|
||||
name: "widgets/dialog/text";
|
||||
parts {
|
||||
part {
|
||||
name: "text";
|
||||
type: TEXTBLOCK;
|
||||
mouse_events: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
text {
|
||||
style: "dialog_style";
|
||||
min: 1 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,17 @@ images {
|
|||
image: "e17_button.png" COMP;
|
||||
}
|
||||
|
||||
styles
|
||||
{
|
||||
style {
|
||||
name: "error_style";
|
||||
base: "font=Edje-Vera font_size=10 align=left color=#000 style=shadow shadow_color=#ffffff80 wrap=word";
|
||||
|
||||
tag: "br" "\n";
|
||||
tag: "hilight" "+ font_size=10 font=Edje-Vera-Bold style=glow color=#fff glow2_color=#fe87 glow_color=#fa14";
|
||||
}
|
||||
}
|
||||
|
||||
group {
|
||||
name: "error/main";
|
||||
min: 400 200;
|
||||
|
@ -113,7 +124,7 @@ group {
|
|||
color3: 255 255 255 128;
|
||||
text {
|
||||
text: "Title";
|
||||
font: "Edje Vera Bold";
|
||||
font: "Edje-Vera-Bold";
|
||||
size: 12;
|
||||
min: 0 0;
|
||||
align: 0.0 0.5;
|
||||
|
@ -122,7 +133,7 @@ group {
|
|||
}
|
||||
part {
|
||||
name: "text";
|
||||
type: SWALLOW;
|
||||
type: TEXTBLOCK;
|
||||
mouse_events: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
|
@ -133,10 +144,14 @@ group {
|
|||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.0;
|
||||
offset: -1 -16;
|
||||
offset: -17 -17;
|
||||
to_y: "button_image";
|
||||
}
|
||||
color: 0 0 0 0;
|
||||
text {
|
||||
style: "error_style";
|
||||
min: 1 1;
|
||||
text: "An Error<br>Goes Here.";
|
||||
}
|
||||
}
|
||||
}
|
||||
part {
|
||||
|
@ -199,7 +214,7 @@ group {
|
|||
color3: 255 255 255 128;
|
||||
text {
|
||||
text: "OK";
|
||||
font: "Edje Vera";
|
||||
font: "Edje-Vera";
|
||||
size: 10;
|
||||
min: 0 0;
|
||||
align: 0.5 0.5;
|
||||
|
|
|
@ -594,7 +594,7 @@ group {
|
|||
color3: 255 255 255 128;
|
||||
text {
|
||||
text: "Item Label";
|
||||
font: "Edje Vera";
|
||||
font: "Edje-Vera";
|
||||
size: 10;
|
||||
min: 1 1;
|
||||
align: 0.0 0.5;
|
||||
|
|
|
@ -87,7 +87,7 @@ group {
|
|||
color3: 255 255 255 128;
|
||||
text {
|
||||
text: "X Y";
|
||||
font: "Edje Vera";
|
||||
font: "Edje-Vera";
|
||||
size: 10;
|
||||
align: 0.5 0.5;
|
||||
min: 1 1;
|
||||
|
|
|
@ -115,7 +115,7 @@ group {
|
|||
color3: 0 0 0 22;
|
||||
text {
|
||||
text: "Title goes here";
|
||||
font: "Edje Vera Bold";
|
||||
font: "Edje-Vera-Bold";
|
||||
size: 12;
|
||||
min: 1 1;
|
||||
align: 0.5 0.5;
|
||||
|
|
|
@ -87,7 +87,7 @@ group {
|
|||
color3: 255 255 255 128;
|
||||
text {
|
||||
text: "WIDTHxHEIGHT";
|
||||
font: "Edje Vera";
|
||||
font: "Edje-Vera";
|
||||
size: 10;
|
||||
align: 0.5 0.5;
|
||||
min: 1 1;
|
||||
|
|
|
@ -180,7 +180,7 @@ group {
|
|||
color3: 0 0 0 22;
|
||||
text {
|
||||
text: "Title goes here";
|
||||
font: "Edje Vera Bold";
|
||||
font: "Edje-Vera-Bold";
|
||||
size: 10;
|
||||
min: 0 1;
|
||||
align: 0.5 0.0;
|
||||
|
@ -226,7 +226,7 @@ group {
|
|||
color3: 0 0 0 22;
|
||||
text {
|
||||
text: "Title goes here";
|
||||
font: "Edje Vera Bold";
|
||||
font: "Edje-Vera-Bold";
|
||||
size: 10;
|
||||
min: 0 1;
|
||||
align: 0.0 0.5;
|
||||
|
@ -525,7 +525,7 @@ group {
|
|||
color3: 255 255 255 128;
|
||||
text {
|
||||
text: "Item Label";
|
||||
font: "Edje Vera";
|
||||
font: "Edje-Vera";
|
||||
size: 10;
|
||||
min: 0 1;
|
||||
align: 0.0 0.5;
|
||||
|
|
|
@ -56,36 +56,12 @@ e_dialog_new(E_Container *con)
|
|||
evas_object_move(o, 0, 0);
|
||||
evas_object_show(o);
|
||||
|
||||
o = evas_object_textblock_add(e_win_evas_get(dia->win));
|
||||
o = edje_object_add(e_win_evas_get(dia->win));
|
||||
dia->text_object = o;
|
||||
e_theme_edje_object_set(o, "base/theme/dialog",
|
||||
"widgets/dialog/text");
|
||||
edje_object_part_swallow(dia->bg_object, "content_swallow", o);
|
||||
evas_object_show(o);
|
||||
{
|
||||
char format[1024];
|
||||
char *fname;
|
||||
int fsize;
|
||||
|
||||
fname = (char *)e_font_default_string_get("default", &fsize);
|
||||
snprintf(format, sizeof(format),
|
||||
"font='%s' size=%i wrap=word",
|
||||
fname, fsize);
|
||||
evas_object_textblock_format_insert(o, format);
|
||||
evas_object_textblock_format_insert(o, "color=#000");
|
||||
#if 0
|
||||
evas_object_textblock_format_insert(o, "\n");
|
||||
evas_object_textblock_text_insert(o, "Here is some text");
|
||||
evas_object_textblock_format_insert(o, "\n");
|
||||
evas_object_textblock_text_insert(o, "Here is some more text");
|
||||
evas_object_textblock_format_insert(o, "\n");
|
||||
evas_object_textblock_text_insert(o, "And even more text on this line to make it really long for testing");
|
||||
evas_object_textblock_format_insert(o, "\n");
|
||||
evas_object_textblock_text_insert(o, "Short");
|
||||
evas_object_textblock_format_insert(o, "\n");
|
||||
evas_object_textblock_text_insert(o, "Aaardvaaarks On!");
|
||||
evas_object_textblock_format_insert(o, "\n");
|
||||
evas_object_textblock_format_insert(o, "\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
o = e_box_add(e_win_evas_get(dia->win));
|
||||
dia->box_object = o;
|
||||
|
@ -139,7 +115,7 @@ e_dialog_title_set(E_Dialog *dia, char *title)
|
|||
void
|
||||
e_dialog_text_set(E_Dialog *dia, char *text)
|
||||
{
|
||||
evas_object_textblock_text_insert(dia->text_object, text);
|
||||
edje_object_part_text_set(dia->text_object, "text", text);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -154,9 +130,8 @@ e_dialog_show(E_Dialog *dia)
|
|||
Evas_Object *o;
|
||||
|
||||
o = dia->text_object;
|
||||
// evas_object_textblock_format_size_get(o, &mw, &mh);
|
||||
evas_object_textblock_native_size_get(o, &mw, &mh);
|
||||
edje_extern_object_min_size_set(o, mw + 2, mh + 2);
|
||||
edje_object_size_min_calc(o, &mw, &mh);
|
||||
edje_extern_object_min_size_set(o, mw, mh);
|
||||
edje_object_part_swallow(dia->bg_object, "content_swallow", o);
|
||||
|
||||
o = dia->box_object;
|
||||
|
|
|
@ -268,9 +268,9 @@ e_error_message_manager_show(E_Manager *man, char *title, char *txt)
|
|||
else
|
||||
{
|
||||
char format[1024];
|
||||
Evas_Object *text;
|
||||
int x, y, w, h, nw, nh;
|
||||
char *fname;
|
||||
int x, y, w, h;
|
||||
Evas_Coord ow, oh;
|
||||
char *fname, *newstr;
|
||||
int fsize;
|
||||
|
||||
evas_object_move(o, 0, 0);
|
||||
|
@ -280,41 +280,45 @@ e_error_message_manager_show(E_Manager *man, char *title, char *txt)
|
|||
evas_object_show(o);
|
||||
|
||||
edje_object_part_text_set(o, "title", title);
|
||||
|
||||
fname = (char *)e_font_default_string_get("default", &fsize);
|
||||
snprintf(format, sizeof(format),
|
||||
"font='%s' size=%i wrap=word",
|
||||
fname, fsize);
|
||||
text = evas_object_textblock_add(e);
|
||||
evas_object_color_set(text, 0, 0, 0, 255);
|
||||
evas_object_textblock_format_insert(text, format);
|
||||
|
||||
{
|
||||
char *pp, *newstr, *p;
|
||||
char *pp, *newstr, *p, *markup = NULL;
|
||||
|
||||
newstr = strdup(txt);
|
||||
p = newstr;
|
||||
while (p)
|
||||
{
|
||||
pp = strchr(p, '\n');
|
||||
if (pp) *pp = 0;
|
||||
evas_object_textblock_text_insert(text, p);
|
||||
if (markup)
|
||||
{
|
||||
markup = realloc(markup, strlen(markup) + strlen(p) + 1);
|
||||
strcat(markup, p);
|
||||
}
|
||||
else
|
||||
markup = strdup(p);
|
||||
if (pp)
|
||||
{
|
||||
p = pp + 1;
|
||||
evas_object_textblock_format_insert(text, "\n");
|
||||
if (markup)
|
||||
{
|
||||
markup = realloc(markup, strlen(markup) + strlen("<br>") + 1);
|
||||
strcat(markup, "<br>");
|
||||
}
|
||||
else
|
||||
markup = strdup("<br>");
|
||||
}
|
||||
else
|
||||
p = NULL;
|
||||
}
|
||||
edje_object_part_text_set(o, "text", markup);
|
||||
free(markup);
|
||||
free(newstr);
|
||||
}
|
||||
edje_object_part_swallow(o, "text", text);
|
||||
evas_object_show(text);
|
||||
|
||||
edje_object_part_geometry_get(o, "text", &x, &y, &w, &h);
|
||||
evas_object_textblock_format_size_get(text, &nw, &nh);
|
||||
/* FIXME: How to handle the width of the text? */
|
||||
error_h += (nh - h);
|
||||
|
||||
edje_object_size_min_calc(o, &ow, &oh);
|
||||
error_w = ow;
|
||||
error_h = oh;
|
||||
|
||||
evas_object_move(o, 0, 0);
|
||||
evas_object_resize(o, error_w, error_h);
|
||||
evas_object_show(o);
|
||||
|
|
|
@ -281,7 +281,7 @@ _e_test_internal(E_Container *con)
|
|||
ecore_timer_add(0.02, _e_test_timer, m);
|
||||
}
|
||||
}
|
||||
#elif 0
|
||||
#elif 1
|
||||
static void
|
||||
_e_test_dialog_del(void *obj)
|
||||
{
|
||||
|
@ -299,6 +299,7 @@ _e_test_internal(E_Container *con)
|
|||
dia = e_dialog_new(con);
|
||||
e_object_del_attach_func_set(E_OBJECT(dia), _e_test_dialog_del);
|
||||
e_dialog_title_set(dia, "A Test Dialog");
|
||||
e_dialog_text_set(dia, "A Test Dialog<br>And another line<br><hilight>Hilighted Text</hilight>");
|
||||
e_dialog_button_add(dia, "OK", NULL, NULL, NULL);
|
||||
e_dialog_button_add(dia, "Apply", NULL, NULL, NULL);
|
||||
e_dialog_button_add(dia, "Cancel", NULL, NULL, NULL);
|
||||
|
|
Loading…
Reference in New Issue