Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: sky/sdk/lib/framework/editing2/editable_text.dart

Issue 1163973005: Start making input work (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/editing2/editable_string.dart ('k') | sky/sdk/lib/framework/editing2/keyboard.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
);
}
}
« no previous file with comments | « sky/sdk/lib/framework/editing2/editable_string.dart ('k') | sky/sdk/lib/framework/editing2/keyboard.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698