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:
Hans Muller
2015-06-16 16:48:08 -07:00
parent cc76b90450
commit 9cb9e2ed8d
4 changed files with 17 additions and 9 deletions

View File

@@ -80,13 +80,14 @@ class RenderTouchDemo extends RenderBox {
AppView app;
void main() {
var para = new RenderParagraph(text: "Touch me!");
var paragraph = new RenderParagraph(new InlineText("Touch me!"));
var stack = new RenderStack(children: [
new RenderTouchDemo(),
para,
paragraph,
]);
// Make the paragraph not fill the whole screen so it doesn't eat events.
para.parentData..top = 40.0
..left = 20.0;
// Prevent the RenderParagraph from filling the whole screen so
// that it doesn't eat events.
paragraph.parentData..top = 40.0
..left = 20.0;
app = new AppView(root: stack);
}