| OLD | NEW |
| 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 '../fn.dart'; | 5 import '../fn.dart'; |
| 6 import 'button_base.dart'; | 6 import '../theme/shadows.dart'; |
| 7 import 'material.dart'; | 7 import 'material.dart'; |
| 8 | 8 |
| 9 class Button extends ButtonBase { | 9 class Button extends Component { |
| 10 static final Style _style = new Style(''' | 10 static final Style _style = new Style(''' |
| 11 display: inline-flex; |
| 11 transform: translateX(0); | 12 transform: translateX(0); |
| 12 display: inline-flex; | 13 -webkit-user-select: none; |
| 13 border-radius: 4px; | |
| 14 justify-content: center; | 14 justify-content: center; |
| 15 align-items: center; | 15 align-items: center; |
| 16 border: 1px solid blue; | 16 height: 36px; |
| 17 -webkit-user-select: none; | 17 min-width: 64px; |
| 18 margin: 5px;''' | 18 padding: 0 8px; |
| 19 ); | 19 margin: 4px; |
| 20 | 20 border-radius: 2px;''' |
| 21 static final Style _highlightStyle = new Style(''' | |
| 22 transform: translateX(0); | |
| 23 display: inline-flex; | |
| 24 border-radius: 4px; | |
| 25 justify-content: center; | |
| 26 align-items: center; | |
| 27 border: 1px solid blue; | |
| 28 -webkit-user-select: none; | |
| 29 margin: 5px; | |
| 30 background-color: orange;''' | |
| 31 ); | 21 ); |
| 32 | 22 |
| 33 Node content; | 23 Node content; |
| 24 int level; |
| 34 | 25 |
| 35 Button({ Object key, this.content }) : super(key: key); | 26 Button({ Object key, this.content, this.level }) : super(key: key); |
| 36 | 27 |
| 37 Node build() { | 28 Node build() { |
| 38 return new Material( | 29 return new Material( |
| 39 style: highlight ? _highlightStyle : _style, | 30 styles: [_style], |
| 40 children: [content] | 31 children: [content], |
| 32 level: level |
| 41 ); | 33 ); |
| 42 } | 34 } |
| 43 } | 35 } |
| OLD | NEW |