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

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

Issue 1216323002: Add a TabNavigator to the Stocks demo (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
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 'dart:async'; 5 import 'dart:async';
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 7
8 import '../painting/text_style.dart'; 8 import '../painting/text_style.dart';
9 import '../rendering/object.dart'; 9 import '../rendering/object.dart';
10 import '../widgets/basic.dart'; 10 import '../widgets/basic.dart';
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void _stopCursorTimer() { 60 void _stopCursorTimer() {
61 _cursorTimer.cancel(); 61 _cursorTimer.cancel();
62 _cursorTimer = null; 62 _cursorTimer = null;
63 _showCursor = false; 63 _showCursor = false;
64 } 64 }
65 65
66 void _paintCursor(sky.Canvas canvas, Size size) { 66 void _paintCursor(sky.Canvas canvas, Size size) {
67 if (!_showCursor) 67 if (!_showCursor)
68 return; 68 return;
69 69
70 print("Draw cursor");
71 Rect cursorRect = new Rect.fromLTWH( 70 Rect cursorRect = new Rect.fromLTWH(
72 _kCursorGap, 71 _kCursorGap,
73 -_kCursorHeightOffset, 72 -_kCursorHeightOffset,
74 _kCursorWidth, 73 _kCursorWidth,
75 style.fontSize + 2 * _kCursorHeightOffset 74 style.fontSize + 2 * _kCursorHeightOffset
76 ); 75 );
77 canvas.drawRect(cursorRect, new Paint()..color = cursorColor); 76 canvas.drawRect(cursorRect, new Paint()..color = cursorColor);
78 } 77 }
79 78
80 Widget build() { 79 Widget build() {
(...skipping 20 matching lines...) Expand all
101 100
102 Widget cursor = new Container( 101 Widget cursor = new Container(
103 height: style.fontSize, 102 height: style.fontSize,
104 width: _kCursorGap + _kCursorWidth, 103 width: _kCursorGap + _kCursorWidth,
105 child: new CustomPaint(callback: _paintCursor, token: _showCursor) 104 child: new CustomPaint(callback: _paintCursor, token: _showCursor)
106 ); 105 );
107 106
108 return new Flex([text, cursor]); 107 return new Flex([text, cursor]);
109 } 108 }
110 } 109 }
OLDNEW
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | sky/sdk/lib/widgets/fixed_height_scrollable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698