Edje Textblock Part
The textblock part type is used to display text in multiple lines. Since it uses Edje Styles to do the formatting, the designer can change the way each style tag is going to affect the text.
part {
name: "partName";
type: TEXTBLOCK;
description {
state: "default" 0.0;
text {
style: "styleName";
}
rel1 {
}
rel2 {
}
}
}
style: "styleName"; This is the name of the Edje Style to use in the part as defined in the styles container. This is a required property.
Differences with Text
The textblock type has many properties in common with the text part type. Support for some properties has been removed since they are already implemented in the style block.
Properties that will work
text min source text_source
Properties that work but might be overridden by the style block
effect color, color2 and color3
Properties that won't work
font size elipsis fit align
Example textblock with style
The following is a simple example on how to use a style alongside a textblock.
The example should compile cleanly and the result, once loaded in an Edje viewer application, should be similar to the screenshot in this article.
styles
{
style {
name: "textblock_style";
base: "font=Edje-Vera font_size=12 align=left valign=bottom color=#000 wrap=word";
tag: "salute" " font_size=15 color=#fff style=soft_shadow shadow_color=#000";
tag: "/salute" "- \n";
tag: "response" " font_size=10 style=outline outline_color=#fff";
tag: "highlight" "+ style=underline underline_color=#000A underline2_color=#0005";
tag: "time" "+ color=#00f";
tag: "scary" "+ color=#f00 style=soft_outline outline_color=#f005";
tag: "mega_br" " \n \n";
tag: "br" " \n";
}
}
collections {
group {
name: "tutorial.parts";
parts {
part {
name: "testing_textblock";
type: TEXTBLOCK;
description {
state: "default" 0.0;
text {
text: "<salute>Hello everybody!</salute><response>Hello Dr. Nick!</response><mega_br>There <highlight>nothing else</highlight> here. <br><time>now</time> prepare to <scary>die!</scare>";
style: "textblock_style";
min: 0 0;
}
}
}
} //Parts
} //Group
} //Collection
Attachments
-
Textblock_example.png
(67.6 KB) -
added by anonymous 20 months ago.

