| Index: sky/sdk/lib/editing/input.dart
|
| diff --git a/sky/sdk/lib/editing/input.dart b/sky/sdk/lib/editing/input.dart
|
| index e8488ac7e95f1765dc94d088d8df81ebb8b05ad6..f86e993882ed14135ef81415111ec4f473993e8e 100644
|
| --- a/sky/sdk/lib/editing/input.dart
|
| +++ b/sky/sdk/lib/editing/input.dart
|
| @@ -3,15 +3,17 @@
|
| // found in the LICENSE file.
|
|
|
| import '../painting/text_style.dart';
|
| -import '../theme/colors.dart';
|
| -import '../theme/typography.dart' as typography;
|
| import '../widgets/basic.dart';
|
| +import '../widgets/theme.dart';
|
| import 'editable_string.dart';
|
| import 'editable_text.dart';
|
| import 'keyboard.dart';
|
|
|
| typedef void ValueChanged(value);
|
|
|
| +const double _kHintOpacity = 0.26;
|
| +const EdgeDims _kTextfieldPadding = const EdgeDims.symmetric(vertical: 8.0);
|
| +
|
| class Input extends Component {
|
|
|
| Input({String key,
|
| @@ -25,8 +27,6 @@ class Input extends Component {
|
| );
|
| }
|
|
|
| - static final TextStyle _placeholderStyle = typography.black.caption;
|
| -
|
| String placeholder;
|
| ValueChanged onChanged;
|
| bool focused = false;
|
| @@ -56,23 +56,33 @@ class Input extends Component {
|
| _isAttachedToKeyboard = true;
|
| }
|
|
|
| + TextStyle textStyle = Theme.of(this).text.subhead;
|
| List<Widget> textChildren = <Widget>[];
|
| +
|
| if (placeholder != null && _value.isEmpty) {
|
| - textChildren.add(new Text(placeholder, style: _placeholderStyle));
|
| + Widget child = new Opacity(
|
| + key: "placeholder",
|
| + child: new Text(placeholder, style: textStyle),
|
| + opacity: _kHintOpacity
|
| + );
|
| + textChildren.add(child);
|
| }
|
| - textChildren.add(
|
| - new EditableText(value: _editableValue, focused: focused)
|
| - );
|
| +
|
| + textChildren.add(new EditableText(
|
| + value: _editableValue,
|
| + focused: focused,
|
| + style: textStyle,
|
| + cursorColor: Theme.of(this).primary[200]
|
| + ));
|
|
|
| Border focusHighlight = new Border(bottom: new BorderSide(
|
| - color: focused ? Blue[400] : Grey[200],
|
| + color: focused ? Theme.of(this).primary[400] : Theme.of(this).primary[200],
|
| width: focused ? 2.0 : 1.0
|
| ));
|
|
|
| - // TODO(hansmuller): white-space: pre, height: 1.2em.
|
| Container input = new Container(
|
| child: new Stack(textChildren),
|
| - padding: const EdgeDims.only(left: 8.0, right: 8.0, bottom: 12.0),
|
| + padding: _kTextfieldPadding,
|
| decoration: new BoxDecoration(border: focusHighlight)
|
| );
|
|
|
|
|