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

Side by Side Diff: sky/sdk/lib/editing/input.dart

Issue 1232313002: Use package:sky imports consistently (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix BUILD.gn Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/editing/editable_text.dart ('k') | sky/sdk/lib/editing/keyboard.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import '../painting/text_style.dart'; 5 import 'package:sky/editing/editable_string.dart';
6 import '../widgets/basic.dart'; 6 import 'package:sky/editing/editable_text.dart';
7 import '../widgets/theme.dart'; 7 import 'package:sky/mojo/keyboard.dart';
8 import 'editable_string.dart'; 8 import 'package:sky/painting/text_style.dart';
9 import 'editable_text.dart'; 9 import 'package:sky/widgets/basic.dart';
10 import 'keyboard.dart'; 10 import 'package:sky/widgets/theme.dart';
11 11
12 typedef void ValueChanged(value); 12 typedef void ValueChanged(value);
13 13
14 const double _kHintOpacity = 0.26; 14 const double _kHintOpacity = 0.26;
15 const EdgeDims _kTextfieldPadding = const EdgeDims.symmetric(vertical: 8.0); 15 const EdgeDims _kTextfieldPadding = const EdgeDims.symmetric(vertical: 8.0);
16 16
17 class Input extends StatefulComponent { 17 class Input extends StatefulComponent {
18 18
19 Input({String key, 19 Input({String key,
20 this.placeholder, 20 this.placeholder,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 ThemeData themeData = Theme.of(this); 74 ThemeData themeData = Theme.of(this);
75 Color focusHighlightColor = themeData.accentColor; 75 Color focusHighlightColor = themeData.accentColor;
76 Color cursorColor = themeData.accentColor; 76 Color cursorColor = themeData.accentColor;
77 if (themeData.primarySwatch != null) { 77 if (themeData.primarySwatch != null) {
78 cursorColor = Theme.of(this).primarySwatch[200]; 78 cursorColor = Theme.of(this).primarySwatch[200];
79 focusHighlightColor = focused ? themeData.primarySwatch[400] : themeData.p rimarySwatch[200]; 79 focusHighlightColor = focused ? themeData.primarySwatch[400] : themeData.p rimarySwatch[200];
80 } 80 }
81 81
82 textChildren.add(new EditableText( 82 textChildren.add(new EditableText(
83 value: _editableValue, 83 value: _editableValue,
84 focused: focused, 84 focused: focused,
85 style: textStyle, 85 style: textStyle,
86 cursorColor: cursorColor 86 cursorColor: cursorColor
87 )); 87 ));
88 88
89 Border focusHighlight = new Border(bottom: new BorderSide( 89 Border focusHighlight = new Border(bottom: new BorderSide(
90 color: focusHighlightColor, 90 color: focusHighlightColor,
91 width: focused ? 2.0 : 1.0 91 width: focused ? 2.0 : 1.0
92 )); 92 ));
93 93
94 Container input = new Container( 94 Container input = new Container(
95 child: new Stack(textChildren), 95 child: new Stack(textChildren),
96 padding: _kTextfieldPadding, 96 padding: _kTextfieldPadding,
97 decoration: new BoxDecoration(border: focusHighlight) 97 decoration: new BoxDecoration(border: focusHighlight)
98 ); 98 );
99 99
100 return new Listener( 100 return new Listener(
101 child: input, 101 child: input,
102 onPointerDown: (_) => keyboard.showByRequest() 102 onPointerDown: (_) => keyboard.showByRequest()
103 ); 103 );
104 } 104 }
105 105
106 void didUnmount() { 106 void didUnmount() {
107 if (_isAttachedToKeyboard) 107 if (_isAttachedToKeyboard)
108 keyboard.hide(); 108 keyboard.hide();
109 super.didUnmount(); 109 super.didUnmount();
110 } 110 }
111 } 111 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/editing/editable_text.dart ('k') | sky/sdk/lib/editing/keyboard.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698