| Index: sky/sdk/lib/editing/editable_text.dart
|
| diff --git a/sky/sdk/lib/editing/editable_text.dart b/sky/sdk/lib/editing/editable_text.dart
|
| index 3f5bea54884534448e2ab5545ff4a9dfd3a35499..d49b410a1099c4d14535a05bed2d1d3ec456eec2 100644
|
| --- a/sky/sdk/lib/editing/editable_text.dart
|
| +++ b/sky/sdk/lib/editing/editable_text.dart
|
| @@ -4,6 +4,7 @@
|
|
|
| import 'dart:async';
|
|
|
| +import '../painting/text_style.dart';
|
| import '../widgets/basic.dart';
|
| import 'editable_string.dart';
|
|
|
| @@ -19,10 +20,6 @@ class EditableText extends Component {
|
| // background-color: ${Blue[500]};'''
|
| // );
|
|
|
| - // static final Style _composingStyle = new Style('''
|
| - // text-decoration: underline;'''
|
| - // );
|
| -
|
| EditableString value;
|
| bool focused;
|
|
|
| @@ -64,35 +61,15 @@ class EditableText extends Component {
|
| else if (!focused && _cursorTimer != null)
|
| _stopCursorTimer();
|
|
|
| - //List<Widget> children = new List<Widget>();
|
| - String hack = "";
|
| -
|
| if (!value.composing.isValid) {
|
| - // children.add(new TextFragment(value.text));
|
| - hack += value.text;
|
| - } else {
|
| - hack += value.textBefore(value.composing);
|
| - hack += value.textInside(value.composing);
|
| - hack += value.textAfter(value.composing);
|
| - // if (!composing.isEmpty) {
|
| - // children.add(new TextFragment(
|
| - // composing,
|
| - // key: 'composing',
|
| - // style: _composingStyle
|
| - // ));
|
| - // }
|
| -
|
| - // String afterComposing = value.textAfter(value.composing);
|
| - // if (!afterComposing.isEmpty)
|
| - // children.add(new TextFragment(afterComposing));
|
| + return new Text(value.text);
|
| }
|
|
|
| - // if (_showCursor)
|
| - // children.add(new Container(
|
| - // key: 'cursor',
|
| - // // style: _cursorStyle
|
| - // ));
|
| -
|
| - return new Text(hack);
|
| + return new StyledText(elements: [
|
| + const TextStyle(),
|
| + value.textBefore(value.composing),
|
| + [const TextStyle(decoration: underline), value.textInside(value.composing)],
|
| + value.textAfter(value.composing)
|
| + ]);
|
| }
|
| }
|
|
|