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

Unified Diff: sky/sdk/lib/widgets/icon_button.dart

Issue 1235693002: Make back button on stocks app search bar the accent color (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | sky/sdk/lib/widgets/tool_bar.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/icon_button.dart
diff --git a/sky/sdk/lib/widgets/icon_button.dart b/sky/sdk/lib/widgets/icon_button.dart
index 2b39ec2579ba5520710d694052ab318738eb88bd..dbcd0af46b3dde4a9c513815cf60e35a8b8d9a6d 100644
--- a/sky/sdk/lib/widgets/icon_button.dart
+++ b/sky/sdk/lib/widgets/icon_button.dart
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import 'dart:sky' as sky;
+
import '../rendering/box.dart';
import 'basic.dart';
import 'icon.dart';
@@ -9,16 +11,25 @@ import 'widget.dart';
class IconButton extends Component {
- IconButton({ String icon: '', this.onPressed })
+ IconButton({ String icon: '', this.onPressed, this.color })
: super(key: icon), icon = icon;
final String icon;
final Function onPressed;
+ final Color color;
Widget build() {
+ Widget child = new Icon(type: icon, size: 24);
+ if (color != null) {
+ child = new ColorFilter(
+ color: color,
+ transferMode: sky.TransferMode.srcATop,
+ child: child
+ );
+ }
return new Listener(
child: new Padding(
- child: new Icon(type: icon, size: 24),
+ child: child,
padding: const EdgeDims.all(8.0)),
onGestureTap: (_) {
if (onPressed != null)
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | sky/sdk/lib/widgets/tool_bar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698