Index: sky/sdk/lib/framework/editing2/editable_text.dart |
diff --git a/sky/sdk/lib/framework/editing/editable_text.dart b/sky/sdk/lib/framework/editing2/editable_text.dart |
similarity index 53% |
copy from sky/sdk/lib/framework/editing/editable_text.dart |
copy to sky/sdk/lib/framework/editing2/editable_text.dart |
index c8a7bf7ed91577f701c82871e3043cd5c52e7570..711e930360c196665a5ddd2f588849160132047a 100644 |
--- a/sky/sdk/lib/framework/editing/editable_text.dart |
+++ b/sky/sdk/lib/framework/editing2/editable_text.dart |
@@ -2,23 +2,23 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-import '../fn.dart'; |
+import '../fn2.dart'; |
import '../theme/colors.dart'; |
import 'dart:async'; |
import 'editable_string.dart'; |
class EditableText extends Component { |
- static final Style _cursorStyle = new Style(''' |
- width: 2px; |
- height: 1.2em; |
- vertical-align: top; |
- background-color: ${Blue[500]};''' |
- ); |
+ // static final Style _cursorStyle = new Style(''' |
+ // width: 2px; |
+ // height: 1.2em; |
+ // vertical-align: top; |
+ // background-color: ${Blue[500]};''' |
+ // ); |
- static final Style _composingStyle = new Style(''' |
- text-decoration: underline;''' |
- ); |
+ // static final Style _composingStyle = new Style(''' |
+ // text-decoration: underline;''' |
+ // ); |
EditableString value; |
bool focused; |
@@ -57,34 +57,43 @@ class EditableText extends Component { |
else if (!focused && _cursorTimer != null) |
_stopCursorTimer(); |
- List<UINode> children = new List<UINode>(); |
+ //List<UINode> children = new List<UINode>(); |
+ String hack = ""; |
if (!value.composing.isValid) { |
- children.add(new TextFragment(value.text)); |
+ // children.add(new TextFragment(value.text)); |
+ hack += value.text; |
} else { |
String beforeComposing = value.textBefore(value.composing); |
- if (!beforeComposing.isEmpty) |
- children.add(new TextFragment(beforeComposing)); |
- |
- String composing = value.textInside(value.composing); |
- if (!composing.isEmpty) { |
- children.add(new TextFragment( |
- composing, |
- key: 'composing', |
- style: _composingStyle |
- )); |
+ if (!beforeComposing.isEmpty) { |
+ // children.add(new TextFragment(beforeComposing)); |
+ hack += value.beforeComposing; |
} |
- String afterComposing = value.textAfter(value.composing); |
- if (!afterComposing.isEmpty) |
- children.add(new TextFragment(afterComposing)); |
+ String composing = value.textInside(value.composing); |
+ hack += value.composing; |
+ hack += value.afterComposing; |
+ // 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)); |
} |
- if (_showCursor) |
- children.add(new Container(key: 'cursor', style: _cursorStyle)); |
+ // if (_showCursor) |
+ // children.add(new Container( |
+ // key: 'cursor', |
+ // // style: _cursorStyle |
+ // )); |
return new Paragraph( |
- children: children |
+ text: hack |
); |
} |
} |