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

Side by Side Diff: sky/framework/components/button.dart

Issue 993033003: Move example fn widgets into sky/framework/components (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/examples/stocks-fn/stocksapp.dart ('k') | sky/framework/components/button_base.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 part of widgets; 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
3 // found in the LICENSE file.
4
5 import '../fn.dart';
6 import 'button_base.dart';
2 7
3 class Button extends ButtonBase { 8 class Button extends ButtonBase {
4 9 static final Style _style = new Style('''
5 static Style _style = new Style('''
6 transform: translateX(0); 10 transform: translateX(0);
7 display: inline-flex; 11 display: inline-flex;
8 border-radius: 4px; 12 border-radius: 4px;
9 justify-content: center; 13 justify-content: center;
10 align-items: center; 14 align-items: center;
11 border: 1px solid blue; 15 border: 1px solid blue;
12 -webkit-user-select: none; 16 -webkit-user-select: none;
13 margin: 5px;''' 17 margin: 5px;'''
14 ); 18 );
15 19
16 static Style _highlightStyle = new Style(''' 20 static final Style _highlightStyle = new Style('''
17 transform: translateX(0); 21 transform: translateX(0);
18 display: inline-flex; 22 display: inline-flex;
19 border-radius: 4px; 23 border-radius: 4px;
20 justify-content: center; 24 justify-content: center;
21 align-items: center; 25 align-items: center;
22 border: 1px solid blue; 26 border: 1px solid blue;
23 -webkit-user-select: none; 27 -webkit-user-select: none;
24 margin: 5px; 28 margin: 5px;
25 background-color: orange;''' 29 background-color: orange;'''
26 ); 30 );
27 31
28 Node content; 32 Node content;
29 33
30 Button({ Object key, this.content }) : super(key: key); 34 Button({ Object key, this.content }) : super(key: key);
31 35
32 Node build() { 36 Node build() {
33 return new Container( 37 return new Container(
34 key: 'Button', 38 style: highlight ? _highlightStyle : _style,
35 style: _highlight ? _highlightStyle : _style,
36 children: [super.build(), content] 39 children: [super.build(), content]
37 ); 40 );
38 } 41 }
39 } 42 }
OLDNEW
« no previous file with comments | « sky/examples/stocks-fn/stocksapp.dart ('k') | sky/framework/components/button_base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698