Styling for text fragments
This is a completion of Eric's WIP patch: https://codereview.chromium.org/1179663005/ Low level support for creating a paragraph that contains runs of styled text. The styles may be nested. The Paragraph and RenderParagraph classes have been replaced by Inline and RenderInline. Styled text is defined with a tree of InlineText and InlineStyle objects. R=abarth@chromium.org Review URL: https://codereview.chromium.org/1177833012.
This commit is contained in:
@@ -31,9 +31,12 @@ andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola
|
||||
alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl.
|
||||
Pancetta meatball tongue tenderloin rump tail jowl boudin.""";
|
||||
|
||||
var text = new InlineStyle(
|
||||
new TextStyle(color: const Color(0xFF009900)),
|
||||
[new InlineText(meatyString)]);
|
||||
child = new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)),
|
||||
child: new RenderParagraph(text: meatyString, color: const Color(0xFF009900))
|
||||
child: new RenderParagraph(text)
|
||||
);
|
||||
flexRoot.add(child);
|
||||
child.parentData.flex = 1;
|
||||
|
||||
Reference in New Issue
Block a user